Use Postgres for your events table

submited by
Style Pass
2024-11-27 20:00:03

If you've reached any modicum of usage with a SaaS product, you've probably been required to implement an events table. This requirement can come in several forms, for example:

One trend that I've observed in recent startups — likely due to the explosion of open-source time-series databases — is the tendency to adopt a specialized OLAP stack like Kafka + Clickhouse much earlier than necessary to index and store billions of events.

For those who would like to dive deeper into code or view full query examples that you can use in your application, check out the pg-events Github repo here (opens in a new tab) .

There are lots of reasons to store events in your system — in this post, I'd like to focus on the three common use-cases that we've recently seen while building Hatchet (opens in a new tab) :

For each use-case and example events table, I've documented common pitfalls and some strategies for scaling these events under higher load.

Leave a Comment