<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Infrastructure on Nimbus</title><link>https://k-s-pavan-kumar.github.io/hugo-nimbus/tags/infrastructure/</link><description>Recent content in Infrastructure on Nimbus</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sat, 10 Feb 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://k-s-pavan-kumar.github.io/hugo-nimbus/tags/infrastructure/index.xml" rel="self" type="application/rss+xml"/><item><title>Use PostgreSQL as the primary datastore</title><link>https://k-s-pavan-kumar.github.io/hugo-nimbus/adr/0001-postgresql-primary-datastore/</link><pubDate>Sat, 10 Feb 2024 00:00:00 +0000</pubDate><guid>https://k-s-pavan-kumar.github.io/hugo-nimbus/adr/0001-postgresql-primary-datastore/</guid><description>&lt;h2 id="context"&gt;Context&lt;/h2&gt;
&lt;p&gt;We need a primary datastore for the new billing service. The team has
production experience with both PostgreSQL and MongoDB, and the data model
is relational (accounts, invoices, line items with foreign keys).&lt;/p&gt;
&lt;h2 id="decision"&gt;Decision&lt;/h2&gt;
&lt;p&gt;We will use PostgreSQL 16, managed via RDS, as the primary datastore for all
new services unless a specific workload has a strong document-store or
time-series justification.&lt;/p&gt;
&lt;h2 id="consequences"&gt;Consequences&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Schema migrations require a formal review (see &lt;code&gt;docs/migrations&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;We standardize on one connection-pooling strategy (PgBouncer) across
services, simplifying on-call runbooks.&lt;/li&gt;
&lt;li&gt;Document-shaped data (e.g. audit logs) will need a deliberate exception
request rather than defaulting to Postgres JSONB columns.&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Terraform State Management: Lessons from Production</title><link>https://k-s-pavan-kumar.github.io/hugo-nimbus/blog/post-2/</link><pubDate>Wed, 15 Feb 2023 10:00:00 -0700</pubDate><guid>https://k-s-pavan-kumar.github.io/hugo-nimbus/blog/post-2/</guid><description>&lt;p&gt;Local Terraform state works fine for a weekend project. It falls apart the
moment a second engineer runs &lt;code&gt;terraform apply&lt;/code&gt; against the same
infrastructure. Here&amp;rsquo;s the setup we settled on after a state file conflict
took down a staging environment for an afternoon.&lt;/p&gt;







&lt;div class="alert alert-warning"&gt;
 &lt;div class="flex items-start"&gt;
 &lt;div class="flex-shrink-0"&gt;
 &lt;svg class="h-5 w-5 mt-0.5" fill="none" viewBox="0 0 24 24" stroke="currentColor"&gt;
 &lt;path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 15.5c-.77.833.192 2.5 1.732 2.5z" /&gt;
 &lt;/svg&gt;
 &lt;/div&gt;
 &lt;div class="ml-3 flex-1"&gt;
 
 &lt;h4 class="text-sm font-semibold mb-1"&gt;State files contain secrets&lt;/h4&gt;
 
 &lt;div class="text-sm"&gt;
 Terraform state can include plaintext values for anything marked &lt;code&gt;sensitive&lt;/code&gt;
in your provider — database passwords, API keys, TLS private keys. Treat
your state backend&amp;rsquo;s access controls with the same care as a secrets
manager, not like a build artifact.
 &lt;/div&gt;
 &lt;/div&gt;
 &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id="move-to-a-remote-backend"&gt;Move to a remote backend&lt;/h2&gt;
&lt;p&gt;A local &lt;code&gt;terraform.tfstate&lt;/code&gt; file has no locking and no history. The fix is
a remote backend with state locking built in:&lt;/p&gt;</description></item></channel></rss>