Chapter 14: Deployment: The Staff Is Being Assembled
I must ask your patience.
The preceding thirteen chapters have demonstrated, in considerable detail, how to create materialized views, refresh them on schedule, prevent your ORM from writing to them, and integrate them into every major framework from Python to .NET. You have been shown the SQL. You have been shown the workarounds. You have been shown the advisory locks, the cascade refreshes, the zero-downtime update strategies, and — in one regrettable but necessary section — a Java class with five annotations.
All of this works. It has always worked. PostgreSQL materialized views have been available since version 9.3, released in 2013. The techniques in this book are not new. They are merely underutilized.
But I would be a poor waiter indeed if I invited you to prepare the meal yourself when a kitchen is available.
Gold Lapel is being prepared. It is a self-optimizing PostgreSQL proxy — a single binary, placed between your application and your database, that handles the materialized views, the refresh scheduling, the cache invalidation, the connection pooling, and the query rewriting without requiring a single change to your application code. What this book has taught you to do by hand, it does automatically. What this book has taught you to monitor, it monitors. What this book has taught you to schedule, it schedules.
The establishment, as it were, is being prepared. The head waiter is reviewing the reservations. The sous chef is sharpening the knives. The kitchen is being stocked. And I am told — by sources I trust, though I am not at liberty to name them — that the doors will open shortly.
When they do, you will find the deployment guide has been prepared: CLI installation, Docker configuration, wrapper setup for your framework of choice, and the precise instructions for placing Gold Lapel between your application and PostgreSQL in the time it takes to brew a proper cup of tea.
Until then, I suggest you continue to Part IV, where we address the scaling challenges that Gold Lapel was built to solve. Consider it reconnaissance. By the time the staff arrives, you will understand precisely why you hired them.
One does not rush a proper opening.