Re:How Figma's databases team lived to tell the scale
by simonw on Friday March 15, 2024 @04:10PM
(#39720162)
If you didn't write your application with multi-tenant in mind from the start I would expect you would need to review almost every line of code that touches a database to make a transition like this.
Re:How Figma's databases team lived to tell the scale
by kgeist on Friday March 15, 2024 @07:50PM
(#39721913)
In our code, the only DB-related piece of code which is aware of multi-tenant databases is the getDBConnection(accountId) function. Once you have the connection, you execute exact same SQL queries as before. The function is hidden deep inside the framework/infrastructure layer, so application code is completely unaware of it.
There are logical DBs (folders/files on a single physical server), and there's a few physical servers. We're currently at the stage where the first physical server hosts most of smaller organizations, and all other physical servers are usually dedicated servers for larger clients with high loads.