# PostgreSQL: good option for persistence in production?

**URL:** <https://community.temporal.io/t/postgresql-good-option-for-persistence-in-production/6153>\
**Category:** Community Support\
**Tags:** production, deployment, postgresql\
**Created:** [October 7, 2022, 12:52pm UTC](https://community.temporal.io/t/postgresql-good-option-for-persistence-in-production/6153 "2022-10-07T12:52:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nathan](https://avatars.discourse-cdn.com/v4/letter/n/c5a1d2/32.png) [@Nathan](https://community.temporal.io/u/Nathan)\
**Post date:** [October 7, 2022, 12:52pm UTC](https://community.temporal.io/t/postgresql-good-option-for-persistence-in-production/6153/1 "2022-10-07T12:52:18Z")

</div>

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 !

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [October 8, 2022, 7:20pm UTC](https://community.temporal.io/t/postgresql-good-option-for-persistence-in-production/6153/2 "2022-10-08T19:20:59Z")

</div>

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](https://temporal.io/cloud) that can support practically any load out of the box.

---

<div class="post-metadata">

**Author:** ![Pieter\_Humphrey\_DTSX](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/pieter_humphrey_dtsx/32/2708_2.png) [@Pieter\_Humphrey\_DTSX](https://community.temporal.io/u/Pieter_Humphrey_DTSX)\
**Post date:** [October 14, 2022, 4:27am UTC](https://community.temporal.io/t/postgresql-good-option-for-persistence-in-production/6153/3 "2022-10-14T04:27:35Z")

</div>

@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](https://astra.datastax.com).

---

<div class="post-metadata">

**Author:** ![Admiring\_Aadyasri](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/admiring_aadyasri/32/6558_2.png) [@Admiring\_Aadyasri](https://community.temporal.io/u/Admiring_Aadyasri)\
**Post date:** [January 21, 2025, 3:44am UTC](https://community.temporal.io/t/postgresql-good-option-for-persistence-in-production/6153/4 "2025-01-21T03:44:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [January 22, 2025, 2:39am UTC](https://community.temporal.io/t/postgresql-good-option-for-persistence-in-production/6153/5 "2025-01-22T02:39:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [January 22, 2025, 4:28am UTC](https://community.temporal.io/t/postgresql-good-option-for-persistence-in-production/6153/7 "2025-01-22T04:28:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Admiring\_Aadyasri](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/admiring_aadyasri/32/6558_2.png) [@Admiring\_Aadyasri](https://community.temporal.io/u/Admiring_Aadyasri)\
**Post date:** [January 22, 2025, 4:53am UTC](https://community.temporal.io/t/postgresql-good-option-for-persistence-in-production/6153/8 "2025-01-22T04:53:27Z")

</div>

Plz ignore
