How to choose the right database?

Choosing the right database is often the single most important decision we will ever make when building a highly scalable system.

Key points consider

  • Bad choices would lead to extended downtime, customer impact, and even data loss
  • Make sure we absolutely positive that we need a different database. (Maybe the DB is Slow, breaking, p99 is high, memory overflow)
  • Read the DB manual, try changing the configuration knob to improve existing DB performance – tune memory size, choose different compaction strategies, change garbage collection behavior
  • Understand database architecture, know its limitation, and reach out to experts in the community
  • Tune the application, maybe add a cache, add read replica, try sharding the DB
  • When choosing a database, boring is good, find something stable, read the manual, check limits, read FAQ, and check GitHub issues (in the case of open source databases)
  • Create a realistic test benchmark, make sure it will work, always check p99 not average, check latency, try failing over a node or testing for data corruption during network partitions, and try up or down sharding (if applicable).
  • Plan migration, write details docs, peer review
  • Migrate a small service first (if possible), and learn as much as possible.

Watch the full video from ByteByteGo on YouTube

Leave a Comment