news.volyx.in

How Figma's databases team lived to tell the scale (figma.com)

568 points by pinser98 · 885 days ago · 223 comments on HN

Article summary

Figma's databases team had to scale their Postgres stack to accommodate the company's rapid growth, and after exploring various options, they decided to implement horizontal sharding on top of their existing vertically partitioned RDS Postgres infrastructure. This approach allowed them to minimize developer impact, scale out transparently, and avoid expensive backfills. The team chose to use a combination of colocation, logical sharding, and a DBProxy query engine to achieve this. The implementation took around nine months and enabled Figma to unlock nearly infinite database scalability.

Main themes

  • Database scaling
  • Horizontal sharding
  • Postgres
  • Distributed databases
  • Cloud services
  • Relational data models

What commenters say

  • Using a distributed database from the start could have avoided the need for horizontal sharding, but it may have introduced its own penalties and drawbacks.
  • Some commenters believe that relying on Google's proprietary technology, such as Cloud Spanner, can be risky due to the potential for sudden changes or discontinuation.
  • Others argue that using a distributed database like Spanner can provide significant benefits, including global consistency and serializability, but at a higher cost and with potential latency issues.
  • There is a trade-off between the benefits of using a cloud service like Spanner and the potential risks of vendor lock-in and cost increases.
  • Some developers prefer to use open-source alternatives or roll their own solutions to avoid dependence on a single vendor.
  • The choice of database and scaling approach depends on the specific needs and constraints of the application and business.
  • Horizontal sharding can be a complex and time-consuming process, but it can provide significant scalability benefits when done correctly.
  • The importance of evaluating the total cost of ownership and potential risks when choosing a database or cloud service is emphasized.