There's more...

As we said earlier, building a fully functional API as we discussed here is beyond the scope of this book. However, we have written a reference implementation named Shard Manager, available on GitHub:

https://github.com/OptionsHouse/shard_manager

Shard Manager creates all of the configuration tables and functions that we discussed in this recipe, along with a couple of extras. Further, it operates as a PostgreSQL extension. For example, to create a schema named shard to store the API and configuration tables, we would use these SQL statements:

CREATE SCHEMA shard;
CREATE EXTENSION shard_manager WITH SCHEMA shard;

The documentation is currently somewhat sparse, but there is enough to install and use the provided functions, ...

Get PostgreSQL High Availability Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.