Hi HN, I’m Alvaro Hernandez, Founder of OnGres (OnGres == “ON postGRES”) [01]. I started using Postgres before the year 2,000 --and never looked back. Postgres reliability, feature set, its incredible documentation, Community, and access to source code always fulfilled all mine and my customer’s needs.

Postgres is trivial to install: $ apt-get install postgresql # will get Postgres installed on your laptop. But would you deploy this Postgres to production? You probably want to add connection pooling, high availability, monitoring, log management, backups… you need a Stack of components around Postgres, from its ecosystem, to reach production readiness.

At OnGres we have been providing Postgres Professional Services for years. We love IaC (Infrastructure as Code). One of our realizations was that it was next to impossible to create a “single IaC package” that would contain Postgres and its Stack of components, that would work on any environment. There are just so many different compute, storage and networking components, with different APIs.

So we asked ourselves: is there any “abstraction layer” for distributed infrastructure? The answer was Kubernetes. Kubernetes APIs allowed us to create a single deployable Postgres package, that contains Postgres itself and all its necessary Stack, and run --almost-- anywhere.

Let me ShowHN you today StackGres 1.0.0 [02], a Postgres-aaS on Kubernetes, that allows you to create production-ready Postgres clusters on the cloud or on-prem. StackGres contains the full Stack of Postgres components needed for production:

* High availability and automated failover, using Patroni. Managed DNS endpoints for the primary (rw) and replicas (ro, load balanced) connections.

* Built-in, enabled by default connection-pooling.

* Configurable automated backups with retention policies.

* Prometheus metrics exporter, with auto-binding. Customized Postgres metrics, Grafana dashboards and Postgres alerts.

* Expertly tuned default configurations --which you can optionally override.

So far, this may be “table stakes” as of today. We wanted to provide more. StackGres has introduced significant innovations --while keeping the same Postgres core “boring”-- such as:

* Using Envoy to proxy all Postgres traffic. In collaboration with the Envoy Community, we developed [03] the Postgres filter for Envoy [04]. We use it to add additional monitoring (by inspecting the wire protocol) and to terminate SSL!

* A fully-featured Web Console. It supports everything StackGres can do. And yes, it has a dark mode ;)

* A system to push all Postgres and Patroni logs from the pods to a central server. This central server is a separate, StackGres-managed Postgres database with Timescale for large volume and high velocity logging. Query your logs with SQL or from the Web Console.

* Fully automated “Day 2” DBA operations, including: minor and major version upgrades, controlled cluster restart, container version upgrades, vacuum, repack and even benchmarks!

* A system to dynamically load Postgres extensions into the containers. This allows us to ship lighter containers, while supporting potentially hundreds of extensions --120 as of now [05], with many more to come in the future. Precisely yesterday I gave a presentation at Kubecon about this extension system. You can review the slides in [06].

StackGres is designed to be easy to use, even by non Postgres experts. Our CRDs [07] are declarative and very high level, abstracting away from Postgres low-level details. And you can use them interchangeably with the Web Console for a point-and-click UX.

StackGres is Open Source (AGPLv3), developed on GitLab [08] (congrats for the IPO!), with public issues and dashboards [09], containing detailed descriptions and open for anyone to chime in. Any code or documentation contributions are very welcome, as well as issues and ideas!
With more than 4,500 commits, it’s a large project (40K Java SLOCs and several other Ks between JS and Shell) that took more than 2 years to develop.

Please give it a try, share your thoughts here, and when this ShowHN thread ends feel free to follow up on our Slack [10] and/or Discord [11] public channels. Thank you!

[01] https://ongres.com

[02] https://stackgres.io

[03] https://www.cncf.io/blog/2020/08/13/envoy-1-15-introduces-a-...

[04] https://www.envoyproxy.io/docs/envoy/latest/configuration/li...

[05] https://stackgres.io/extensions/

[06] https://kccncna2021.sched.com/event/lV1u

[07] https://stackgres.io/doc/latest/reference/crd/

[08] https://gitlab.com/ongresinc/stackgres/

[09] https://gitlab.com/ongresinc/stackgres/-/issues

[10] https://slack.stackgres.io

[11] https://discord.stackgres.io