Postgres For Everything

Unlock the full potential of PostgreSQL to streamline your technology stack. Explore tailored solutions for various use cases, transforming how you develop and deploy applications.

Caching

Use Postgres for caching instead of Redis with UNLOGGED tables and TEXT as a JSON data type. Use stored procedures to add and enforce an expiry date for the data just like in Redis.

Also: You Don't Need a Dedicated Cache Service, readyset

Message Queue

Use Postgres as a message queue with SKIP LOCKED instead of Kafka (if you only need a message queue). Or as a job queue in Go with River.

Also: Choose Postgres queue technology, PGMQ

Time Series

Use Postgres with TimescaleDB as a time-series database
github.com/timescale/timescaledb

In-memory OLAP

Use Postgres with pg_analytics as an in memory OLAP with Apache Datafusion

Store JSON documents

Use Postgres with JSONB to store Json documents in a database, search and index them - instead of Mongo

Cron Demon

Use Postgres as a cron demon to take actions at certain times, like sending mails, with pg_cron or pg_timetable

Geospacial queries

Use Postgres for Geospacial queries.
github.com/postgis/postgis

Search

Use Postgres for Fulltext Search instead of Elastic.

Also: ParadeDB, pgvector, Vecto: Hybrid Search with Postgres (pgvector) and Elixir (Ecto), Postgres Full Text Search

Generate and return JSON without backend

Use Postgres to generate JSON in the database, write no server side code and directly give it to the API

Audit Logs

Use Postgres for auditing with pgaudit

Also: temporal_tables, supa_audit, pgMemento

Deliver GraphQL

Use Postgres with a GraphQL adapter to deliver GraphQL if needed

Column Oriented

Use Postgres as Column Oriented database with Hydra or cstore_fdw or ParadeDB pg_analytics and pg_lakehouse

NoSQL

Use Postgres as NoSQL database with FerretDB.

Also: Pongo, dox

Graph Data

Use Postgres for Graph Data

Foreign Data

Use Postgres with foreign data via wrappers

Alternative Query Langauges

Use Alternative Query Langauges in Postgres with plprql or pg_graphql

Make HTTP requests

If you need to make an HTTP requests from your SQL you can use pgsql-http or pg_net

Attribution

11.08.2024

Insights and technical guidance are derived from the article "Just Use Postgres for Everything" by Stephan Schmidt, originally published on Amazing CTO. For more details, visit the article

31.08.2024

More cases added from PostgreSQL is Enough by Chase Pursley

Contribution

If you would like to submit use case please send me an email