Talking to the correct shard
In this section, we have chosen to represent database shards as PostgreSQL schema names. If our basic schema is named myapp, shard 1 would be myapp1, shard 15 would be myapp15, and so on. This is what we call the logical shard name.
Beyond this, shards should be independent of each other so that they can be relocated to another PostgreSQL server arbitrarily; however, if shards can be moved at will, how do we find them? In much the same way that LVM has a physical drive, logical shards have a corresponding physical shard. The physical shard is the server where the logical shard currently resides, as shown in the following diagram:
Elements such as clients, products, and vendors are shared resources that all PostgreSQL ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access