TiDB Brings Distributed Scalability to SQL – InApps Technology is an article under the topic Software Development Many of you are most interested in today !! Today, let’s InApps.net learn TiDB Brings Distributed Scalability to SQL – InApps Technology in today’s post !

Key Summary

This article from InApps Technology, published in 2022 and authored by Phu Nguyen, explores TiDB, an open-source distributed SQL database developed by PingCap (Beijing, China). Presented by Qi (Max) Liu at Percona Live in Amsterdam and updated by Edward Huang in Santa Clara, TiDB combines SQL’s ACID transactions with NoSQL’s scalability, supporting the MySQL protocol for easy integration with minimal code changes. Built on TiKV (a Rust-based key-value store using Raft and RocksDB), TiDB offers horizontal scaling, self-healing, cross-platform compatibility, and online schema changes. Inspired by Google Spanner and F1, it avoids proprietary dependencies, using a loose coupling approach and Timestamp Allocator (from Google’s Percolator) instead of atomic clocks. With over 100 contributors, TiDB serves clients like GAEA (real-time advertising) and Mobike (handling 400M+ orders). Challenges include latency in distributed data centers, with ongoing Kubernetes integration efforts.

  • Context:
    • Author: Phu Nguyen, summarizing PingCap’s TiDB presentations at Percona Live.
    • Theme: TiDB bridges SQL and NoSQL, offering scalable, reliable, and open-source database solutions for enterprise needs.
    • Source: InApps article, with Insight Partners (investor in Docker) as a parent company.
  • Key Points:
    • TiDB Overview:
      • Purpose: Combines SQL’s ACID compliance with NoSQL’s horizontal scalability.
      • MySQL Compatibility: Supports MySQL protocol, enabling drop-in replacement with minimal code changes and reuse of MySQL tools.
      • Open Source: Over 100 contributors, evolved from beta to release candidate by 2022.
    • Features:
      • Scalability: Scales by adding machines, with automatic sharding via TiKV.
      • Reliability: Self-healing from failures, ensuring no data loss.
      • Flexibility: Cross-platform, supports Docker, and is working toward Kubernetes integration.
      • Schema Evolution: Allows online schema changes (e.g., adding columns/indices) without downtime.
    • Architecture:
      • Components: MySQL Server layer, SQL layer, and TiKV (using Rust, Raft, MVCC, RocksDB, and Spark Connector).
      • Inspiration: Draws from Google Spanner and F1 but avoids proprietary dependencies like Colossus.
      • Key Differences:
        • Uses Raft for log storage, reducing write latency compared to Spanner’s file system.
        • Focuses on SQL optimizer enhancements, unlike Spanner’s approach.
        • Relies on Timestamp Allocator (from Google Percolator) instead of atomic clocks for synchronization.
    • Use Cases:
      • GAEA: Supports real-time advertising with high data volumes and peak loads, reducing operation costs via automatic sharding.
      • Mobike: Replaced MySQL for data analysis and online orders (400M+), leveraging TiDB’s scalability.
    • Challenges:
      • Latency: Managing delays across geographically distributed data centers.
      • Kubernetes Integration: Ongoing efforts to enhance compatibility.
    • Comparison to Competitors:
      • Unlike Spanner (tied to Google Compute Engine), TiDB is open-source and platform-agnostic.
      • Competes with CockroachDB, FaunaDB, and TimeScaleDB, focusing on SQL scalability and ease of use.
  • InApps Insight:
    • InApps Technology, ranked 1st in Vietnam and 5th in Southeast Asia for app and software development, specializes in database solutions and cloud-native technologies, using React Native, ReactJS, Node.js, Vue.js, Microsoft’s Power Platform, Azure, Power Fx (low-code), Azure Durable Functions, and GraphQL APIs (e.g., Apollo).
    • Offers outsourcing services for startups and enterprises, delivering cost-effective solutions at 30% of local vendor costs, supported by Vietnam’s 430,000 software developers and 1.03 million ICT professionals.
    • Relevance: Expertise in distributed systems and cloud databases aligns with implementing TiDB-like solutions for scalable enterprise applications.
  • Call to Action:
    • Contact InApps Technology at www.inapps.net or sales@inapps.net to develop distributed database solutions or cloud-native applications for scalability and reliability.
Read More:   A Reunited Node.js Guns for the Enterprise – InApps 2022

Read more about TiDB Brings Distributed Scalability to SQL – InApps Technology at Wikipedia

You can find content about TiDB Brings Distributed Scalability to SQL – InApps Technology from the Wikipedia website

A rash of new databases have emerged, such as Google Spanner, FaunaDB, Cockroach and TimeScaleDB, that are focused on solving the problem of scale that plagues standard SQL. Now another entrant, the Beijing, China-based PingCap’s open source TiDB project, aims to make it as scalable as NoSQL systems while maintaining ACID transactions.

Its support for the MySQL protocol means users can reuse many MySQL tools and greatly reduce migration costs, according to PingCap co-founder and CEO Qi (Max) Liu. You can use it to replace MySQL for applications without changing any code in most cases. And it scales horizontally; increase the capacity simply by adding more machines.

Liu presented TiDB at the Percona Live conference in Amsterdam last October. The project was in beta then; it’s since evolved to release candidate. On Thursday, PingCap co-founder and Chief Technology Officer Edward Huang will be speaking about TiDB at the Percona Live event in Santa Clara, Calif.

They tout that TiDB offers the best of both the SQL and NoSQL worlds. They focused on making it:

  • easy to use;
  • ensuring that no data is ever lost; it is self-healing from failures;
  • cross-platform and can run in any environment;
  • and open source.

It also allows online schema changes, so the schema can evolve with your requirements. You can add new columns and indices without stopping or affecting operations in progress.

As an open source project, it has more than 100 contributors, Liu said in an email interview.

PingCap drew inspiration for TiDB from Google F1 distributed database and Spanner. Google built Spanner atop its own proprietary systems and it’s not open source, considered a downside to some.

Read More:   Uniqueness Is Rare on GitHub – InApps 2025

“With Spanner, you’re making a commitment to running the service in Google Compute Engine (GCE) and probably running it there for the service’s lifetime. You’re not going to have an off-ramp if you choose to run your own stack,” Spencer Kimball, CEO of Cockroach Labs, told InApps Technology previously.

Keeping Track of All the Bikes

TiDB takes a loose coupling approach. It consists of a MySQL Server layer and the SQL layer. Its foundation is the open source distributed transactional key-value database TiKV, another PingCap project, which uses the programming language Rust and the distributed protocol Raft. TiDB is written in Go. Inside TiKV are MVCC (multi-version concurrency control), Raft, and for local key-value storage, it uses RocksDB. It also uses the Spark Connector.

TiDB makes two distinctions from Spanner, Liu said:

While the bottom layer of Spanner relies on Google’s Colossus distributed file system, TiDB ensures that the log is safely stored in the Raft layer. TiDB does not depend on any distributed file system, which greatly lowers write latency.

“We also see great potential in SQL optimizer, but Google didn’t seem to go deep into this aspect in its F1 paper. When designing our project, we aimed to explore the optimizer’s capability,” he said.

Spanner gained attention for its use of atomic clocks to gain time synchronization among geographically distributed data centers. TiDB does not use atomic and GPS clocks. Instead, it relies on Timestamp Allocator introduced in Percolator, a paper published by Google in 2006.

It supports the popular containers such as Docker. And the team is working to make it work with Kubernetes, though, for this work, Liu pointed out difficulties there to the Amsterdam audience.

The biggest problem they’re working on now is latency, especially between geographically distributed data centers, he said, one he hopes to have resolved in the near future.

PingCAP was founded in April 2015 by Huang, a senior distributed system engineer; Cui Qiu, a senior system engineer; and Liu, also an infrastructure engineer. It has 48 engineers working in Beijing and others working remotely from elsewhere in China.

Read More:   Thundra Brings Observability Tracing to Continuous Integration – InApps 2022

Its clients include mobile gaming provider GAEA, which uses TiDB to support its cross-platform real-time advertising system, which requires high-volume data capacity and experiences peak loads during certain periods. TiDB supports automatic sharding and the bottom layer, TiKV, automatically distributes data among the cluster, which helps GAEA cut the cost of operation and maintenance, Liu said.

Another customer is the cashless and station-free bike sharing platform Mobike which uses TiDB for data analysis and to replace a MySQL database for online orders, which now number more than 400 million.

InApps Technology is a wholly owned subsidiary of Insight Partners, an investor in the following companies mentioned in this article: Docker.

Source: InApps.net

Rate this post
As a Senior Tech Enthusiast, I bring a decade of experience to the realm of tech writing, blending deep industry knowledge with a passion for storytelling. With expertise in software development to emerging tech trends like AI and IoT—my articles not only inform but also inspire. My journey in tech writing has been marked by a commitment to accuracy, clarity, and engaging storytelling, making me a trusted voice in the tech community.

Let’s create the next big thing together!

Coming together is a beginning. Keeping together is progress. Working together is success.

Let’s talk

Get a custom Proposal

Please fill in your information and your need to get a suitable solution.

    You need to enter your email to download

      Success. Downloading...