Types of Databases:
Note: Vector DB , Event store
Techniques for Optimizing
- Avoiding Over-Indexing
- Efficient Query Design
- Use of Stored Procedures
Key Metrics to Track
To maintain the health of your database, it’s important to track key metrics that provide insights into its performance and stability:
- QPS (Queries Per Second): Measures the number of queries processed per second, helping you understand the load on your database.
- Latency: Tracks the time taken to execute queries, indicating the responsiveness of your system.
- CPU and Memory Usage: Monitors the resource consumption of your database nodes, ensuring they are not overburdened.
- Disk I/O: Measures the read and write operations on your storage devices, highlighting potential bottlenecks.
- Replication Lag: Indicates the delay in data replication across nodes, which is crucial for maintaining consistency and availability.
Regular Maintenance Practices
Index Rebuilding
Indexes play a vital role in query performance, but they can become fragmented over time, leading to inefficiencies. Regularly rebuilding indexes helps maintain their effectiveness:
- Reorganize Index: This operation defragments the index pages, improving read and write performance without locking the table.
- Rebuild Index: This more intensive operation creates a new index and drops the old one, fully optimizing the index structure. It’s useful for heavily fragmented indexes but may require downtime.
Database Backups
Regular backups are essential for data protection and disaster recovery. TiDB provides several tools and strategies for effective backup management:
- BR (Backup & Restore): A command-line tool designed for large-scale data backup and restoration. It supports both full and incremental backups, allowing you to efficiently manage your backup strategy.
- Dumpling: A lightweight tool for exporting data from TiDB into SQL or CSV files. It’s useful for smaller datasets or when you need to migrate data between environments.
How do you select which database to use?
https://medium.com/@xsronhou/10-types-of-databases-every-software-engineers-should-know-c0f05ed0ec90