lunes, 23 de octubre de 2023

Just use Postgres for everything!

 Just discovered this post https://www.amazingcto.com/postgres-for-everything/ which is short, and to the point.

Copying it verbatim, because it deserves to be read even if you don't click my links

"

One way to simplify your stack and reduce the moving parts, speed up development, lower the risk and deliver more features in your startup is “Use Postgres for everything”. Postgres can replace - up to millions of users - many backend technologies, Kafka, RabbitMQ, Mongo and Redis among them.


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.


Use Postgres as a message queue with SKIP LOCKED instead of Kafka (if you only need a message queue).


Use Postgres with Timescale as a data warehouse.


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


Use Postgres as a cron demon to take actions at certain times, like sending mails, with pg_cron adding events to a message queue.


Use Postgres for Geospacial queries.


Use Postgres for Fulltext Search instead of Elastic.


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


Use Postgres with a GraphQL adapter to deliver GraphQL if needed.


There I’ve said it, just use Postgres for everything.

"


Also, there's a link to radical simplicity, which seems like another iteration of use-boring-technology.

This one is also great gist about using pg for basically everything https://gist.github.com/cpursley/c8fb81fe8a7e5df038158bdfe0f06dbb

No hay comentarios: