Re:Partitioning GitHub’s relational databases to handle scale
by jayd16 on Tuesday September 28, 2021 @10:27AM
(#28683178)
Why invent virtual partitions when you could use something like multiple databases (as in create database) or maybe even multiple user rights?
[ Parent
| on HN ]
Re:Partitioning GitHub’s relational databases to handle scale
by arthurschreiber on Tuesday September 28, 2021 @11:04AM
(#28683636)
As described in the blog post, large paths of our database schema have grown in an organic fashion. These virtual partitions allow us to prepare our database access for splitting out groups of tables into separate clusters in the medium term, with sharding those clusters being a next step and a long term solution to handle our database growth.
Re:Partitioning GitHub’s relational databases to handle scale
by jayd16 on Tuesday September 28, 2021 @11:15AM
(#28683780)
I understand the desire, but why were db users with rights for specific tables or separate databases not enough separation for your interim testing.
What did the virtual partitioning add that those other techniques could not provide?
Re:Partitioning GitHub’s relational databases to handle scale
by arthurschreiber on Tuesday September 28, 2021 @11:27AM
(#28683938)
We could enable the linter in production to silently log problematic queries without actually affecting their execution.
If we used separate db users as you're suggesting, any query that we didn't catch beforehand (e.g. via our CI builds) would cause noticeable problems for our users, which is something that we want to avoid.
Additionally, switching to a separate user account would require holding open twice the amount of connections to each database server (old db user plus new db user), which probably would be fine but is still a lot of additional connections at our scale.
Re:Partitioning GitHub’s relational databases to handle scale
by nycjay on Tuesday September 28, 2021 @11:41AM
(#28684116)
Would it double the number of connections? If you are doing the same volume of total work and not looking to increase concurrency, wouldn't you end up with something closer to two connection pools with ~1/2 the size compared to one connection pool with your old size?
Re:Partitioning GitHub’s relational databases to handle scale
by eska on Wednesday September 29, 2021 @04:46AM
(#28691573)
I think his suggestion was to use service-specific users with limited grants only in the development environment to catch queries that access tables of other services. The production environment would keep using users with grants on all services‘ tables
Re:Partitioning GitHub’s relational databases to handle scale
by nycjay on Wednesday October 06, 2021 @10:01AM
(#28773296)
I see a lot of value of using separate users in both dev/test and production environments. That gives you an "easy" way to physically separate your database/schema into multiple databases with minimal changes to your application other than pointing your connection pools/config to the new database endpoint. We do this often - separating the task of breaking up our monolith databases with two phases - logical then physical.