TiDB is an open-source, MySQL-compatible, distributed SQL database. It scales horizontally like NoSQL but keeps ACID transactions and MySQL syntax.
What Is TiDB?
TiDB (Ti = Titanium) separates compute and storage, scaling each independently. It handles OLTP and OLAP workloads simultaneously (HTAP).
Free tier (TiDB Serverless):
- 25GB row storage
- 25GB columnar storage
- 250M RUs/month
Quick Start
# TiDB Serverless — connect with any MySQL client
mysql -u YOUR_USER -p -h gateway01.us-east-1.prod.aws.tidbcloud.com -P 4000 --ssl-mode=VERIFY_IDENTITY
MySQL-Compatible API
CREATE TABLE products (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255),
price DECIMAL(10,2),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO products (name, price) VALUES ("Widget", 9.99);
-- HTAP: same table, analytical query
SELECT DATE(created_at) as day, SUM(price) as revenue
FROM products
GROUP BY day
ORDER BY day DESC;
REST API (TiDB Cloud)
# Data API (serverless)
curl -X POST https://REGION.data.tidbcloud.com/api/v1beta/app/CLUSTER_ID/endpoint/SQL \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{"sql":"SELECT * FROM products LIMIT 10"}'
Use Cases
- MySQL migration — zero code changes
- Horizontal scaling — grow without sharding
- Real-time analytics — OLTP + OLAP
- Financial systems — distributed ACID
- Multi-cloud — run anywhere
Need web data at scale? Check out my scraping tools on Apify or email spinov001@gmail.com for custom solutions.
Top comments (0)