Database Scaling

Scale read

  • Database sharding
    • However sharding is very hard and complex to get it right which create hotspot problem
  • Database Read replica pattern
  • Caching
  • Indexing
    • Note: do not create an index when the column has a lot of updates or the column has a lot of data, which is very costly to rebalance

Scale write

Connection pooling

  • Use the connection pool to reuse connection
  • use RDS proxy if cloud