PostgreSQL: good option for persistence in production?

Hello dear community !

In my company, we started to use Temporal in different teams for production purpose.
We chose to deploy Temporal with a PostgreSQL persistence backend, for two main reasons: we have a dedicated team with a big knowledge of PostgreSQL who can provide managed PostgreSQL instances, and we don’t have Cassandra experts in my company.

We noticed a couple of things while using Temporal over PostgreSQL:

  • looking at the database schema and the way data are stored, it looks like Temporal works for on a relational database, but does not perfectly fit for a relational database (looks like there’s a lot of encoded data with not so much relation between tables and objects, etc.)
  • we had some strange issue where Temporal server went up to 600/700 simultaneous connections with a spike, with maxConns properly set to 20.
  • we noticed that latency between database and Temporal server has a huge impact on workflow executions performances, as there’s a lot of queries during a workflow execution

We are now wondering if PostgreSQL is supported mainly for development purpose, or if we can go with this persistence backend in production ?
Is there any particular things we need to care about this kind of deployment ? A specific configuration, or stuff like this ?

Does anyone is running Temporal with huge load on PostgreSQL ? Any feedback ?

Thanks a lot !

1 Like

Many users run with PostgreSQL in production. Temporal is indeed pretty chatty by design. So there is a limit to how far you can scale on a single DB server.

Does anyone is running Temporal with huge load on PostgreSQL ? Any feedback ?

Define “huge”. We recommend Cassandra for huge loads as it scales out to many servers.

Consider using Temporal Cloud that can support practically any load out of the box.

@Nathan I think @maxim 's solution is by far the best one, but if you need to self-manage Temporal for some reason, just realize that you may not need Cassandra experts as much as you think, DataStax offers a serverless managed service built on Cassandra, Astra DB.

This seems to be old post , but i would like to know Cassandra is still recommended DB for Huge loads?

1 Like

Yes, Cassandra is still the most scalable option after the Temporal Cloud.

What do you mean? Do you want to drop Cassandra support and keep only MySQL and PostgreSQL?

Plz ignore