Postgres as document store, or "you don't need ORM in Node.js"

For quite few years now I’ve been betting on Postgres. After seeing what it’s capable with PostGIS, FTS and other non-standard SQL workloads, I also started using it as my NoSQL database. In this post I want to share with you how I’m using Postgres as my document store for OLTP workloads. I started using it that way few years ago, when building CrossKeeper (now decommissioned), after getting a “query rewrite fatigue” due to constantly changing requirements....

July 11, 2024

(Not so) simple Postgres queue system skeleton

Postgres is a very versatile database system. It can be used for so much more than just storing data. In this post I’ll show you how you can create a fully functional job queue using Postgres. Note: This post is loosely based on my pgqueue library and code samples might not work out of the bat, as they were adopted to fit the post. When something does not work check library code, or play with it for 5 minutes to find a fix....

July 5, 2024

Circuit breakers - You don't need to wait for failures.

It gets very annoying when web app keeps hanging on server requests, only to fail with a timeout few seconds later. Or uses up all available network connections (remember, we only have handful of these) just to wait for failure. Especially if feature is non critical and it does many updates while you are interacting with the app. Wouldn’t it be nicer if, after failing, app simply stopped trying for some time?...

September 16, 2016

Sharing database between services will hurt you

Sharing database between application services is one of worst and most common anti-patterns you can still see around. It will hurt you in so many ways, yet it looks so nice and easy at the beginning. Going fast like crazy In the beginning it looks like it makes you go fast. You can get all data in application by just querying same database. Every modification you do is immediately visible in other services....

July 31, 2016