<ol>
<li></li>
</ol>
<p>I have 2 applications in 2 pods as well as a Postgres db deployed using a helm chart. The one application writes to the database and the other one uses only select operation for read. Is there any case where I can get a race condition?</p>
<p>2)</p>
<p>Is there any way to have both read and write to the above database from 2 different pods hosting different applications?</p>

christk
<ol>
<li><p>If only one of the two applications will be writing to the database, there should not be any risk of a race condition.</p>
</li>
<li><p>Yes, you can define two pods for the two applications and have them both connect to the database. You could create a <a href="https://helm.sh/docs/chart_template_guide/subcharts_and_globals/" rel="nofollow noreferrer">helm subchart</a> for each application, define the Postgresql connection details in a ConfigMap in the parent chart, and then have each subchart's deployment <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#define-container-environment-variables-using-configmap-data" rel="nofollow noreferrer">load the ConfigMap as environment variables</a> so your applications can connect to the database.</p>
</li>
</ol>
