top | item 36226223

(no title)

jason2323 | 2 years ago

I wonder what their query routing service at the end of the article does and what it’s use is? If they have vertically partitioned their database, shouldn’t their application queries also be split in such a way that they query data from the partitioned database and join them somewhere ?

discuss

order

noisy_boy|2 years ago

I don't have any experience with RoR but your question piqued my curiosity and it seems like you can configure Rails to dynamically decide which database to connect to. That means that in case of a query routing service, your application backend can ask it which databases to connect to based on the requirement (say, a list of entities) and the routing service can provide the relevant connection details which the backend can use to connect without a predefined list of databases in its .yml file. That means your application doesn't have any knowledge of how many databases are there since that knowledge is centralized at the query routing service and can change as migrations happen.

Atleast that is what I guessed from some brief reading - I may be totally wrong.