<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[The Root Address]]></title><description><![CDATA[Bypassing the marketing fluff to reverse-engineer the internet. Decoding system architectures every Sunday.]]></description><link>https://therootaddress.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/65818ce922a2dbe6796da7f5/5d5f07eb-aa35-4e42-a002-48859c8687ba.png</url><title>The Root Address</title><link>https://therootaddress.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Thu, 15 Oct 2026 07:46:37 GMT</lastBuildDate><atom:link href="https://therootaddress.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Managed DB vs Self-Hosted on a Cloud VM: The Database Decision That Looks Cheap Until You Operate It]]></title><description><![CDATA[You can get PostgreSQL running on a cloud VM in a few minutes.
You can also create a managed PostgreSQL instance and let the cloud provider handle a big part of the operational work.
The confusing par]]></description><link>https://therootaddress.hashnode.dev/managed-db-vs-self-hosted-on-a-cloud</link><guid isPermaLink="true">https://therootaddress.hashnode.dev/managed-db-vs-self-hosted-on-a-cloud</guid><category><![CDATA[Cloud]]></category><category><![CDATA[Cloud Computing]]></category><category><![CDATA[virtual machine]]></category><category><![CDATA[PostgreSQL]]></category><dc:creator><![CDATA[Aman Singh]]></dc:creator><pubDate>Thu, 01 Oct 2026 14:08:59 GMT</pubDate><content:encoded><![CDATA[<p>You can get PostgreSQL running on a cloud VM in a few minutes.</p>
<p>You can also create a managed PostgreSQL instance and let the cloud provider handle a big part of the operational work.</p>
<p>The confusing part is not setting up the database.</p>
<p>It is understanding which problems you are actually agreeing to own when you choose one over the other.</p>
<h3><strong>The Problem It Solves</strong></h3>
<p>Before managed databases became common, running a production database usually meant running the database server yourself.</p>
<p>You had a machine, installed PostgreSQL or MySQL on it, configured storage, opened the right network ports, created users, scheduled backups, watched disk usage, applied security patches and figured out what to do when the machine died. Moving that server to AWS EC2, Google Compute Engine or an Azure VM did not fundamentally change that model.</p>
<p>The hardware became someone else's problem.</p>
<p>The database was still yours. That is where managed database services came in.</p>
<p>Services such as <strong>Amazon RDS</strong> and <strong>Google Cloud SQL</strong> take over a large part of the infrastructure and database operations. With a VM, you still have to deal with things like the database software, operating system, backups and scaling. With a managed service, the provider takes responsibility for many of those layers.</p>
<p>But there is an important detail here:</p>
<p>Managed does not mean someone else manages everything.</p>
<p>It means the responsibility boundary has moved.</p>
<p>That distinction is the foundation of this entire comparison.</p>
<h3><strong>What It Actually Is</strong></h3>
<p>Let's take PostgreSQL as an example.</p>
<p>Option A: PostgreSQL on a VM</p>
<p>Your architecture might look something like this:</p>
<pre><code class="language-plaintext">             Your Responsibility
                    |
                    v
          +-------------------+
          |      Cloud VM     |
          |                   |
          |   Linux / Ubuntu  |
          |         |         |
          |     PostgreSQL    |
          |         |         |
          |   Database Storage|
          +-------------------+
                    ^
                    |
                 Your App
</code></pre>
<p>The cloud provider gives you the VM infrastructure. You handle the rest.</p>
<p>If PostgreSQL needs an upgrade, you plan it.</p>
<p>If the disk fills up, you deal with it. If backups fail, you need to find out why.</p>
<p>If the VM dies and you never built a proper recovery strategy, that is also your problem.</p>
<p>Now compare that with a managed database.</p>
<h3><strong>Option B: Managed PostgreSQL</strong></h3>
<p>With something like Cloud SQL:</p>
<pre><code class="language-plaintext">         Your Application
                |
                v
      +----------------------+
      |      Cloud SQL       |
      |                      |
      |      PostgreSQL      |
      |                      |
      |      Backups         |
      |      Maintenance     |
      |      Monitoring      |
      |      HA / Failover   |
      +----------------------+
                |
                v
      Cloud Provider
       Infrastructure
</code></pre>
<p>The database still runs on compute and storage underneath.</p>
<p>The difference is that you do not manage that underlying VM like a normal Compute Engine machine.</p>
<p>Google handles infrastructure, operating system and database software maintenance, while you remain responsible for things such as database configuration, access control, query optimization and deciding whether you need HA or disaster recovery features.</p>
<p>That distinction is the entire topic.</p>
<p>Managed DB does not remove responsibility. It removes a specific class of responsibility.</p>
<h3><strong>How Developers Actually Use It</strong></h3>
<p>Suppose I am deploying a small Node.js API with PostgreSQL.</p>
<p>For a self-hosted setup, I might create a VM:</p>
<p>gcloud compute instances create postgres-vm<br /><code>--zone=asia-south1-a   --machine-type=e2-medium</code></p>
<p>Then SSH into it:</p>
<p>gcloud compute ssh postgres-vm</p>
<p>Install PostgreSQL:</p>
<p><code>sudo apt update sudo apt install postgresql postgresql-contrib</code></p>
<p>At this point, the database is running.</p>
<p>But the work is not over.</p>
<p>I still need to think about:</p>
<p>PostgreSQL configuration Users and authentication Firewall rules Private networking Backups Backup verification Disk capacity Monitoring Upgrades Replication Failover Disaster recovery</p>
<p>That is a lot of responsibility for a database that might initially have 50 users.</p>
<p>With Cloud SQL, the equivalent starts much closer to:</p>
<p>gcloud sql instances create my-postgres<br /><code>--database-version=POSTGRES_16   --region=asia-south1</code></p>
<p>Then:</p>
<p><code>gcloud sql databases create appdb   --instance=my-postgres</code></p>
<p>Your application connects to the managed instance instead of you maintaining the PostgreSQL server itself. Cloud SQL provides built-in capabilities around backups, replication, maintenance, monitoring and high availability.</p>
<p>But this is where the comparison actually gets interesting.</p>
<h3><strong>What Most Tutorials Don't Tell You</strong></h3>
<p>This is where the managed vs self-hosted decision becomes more complicated than a simple pricing comparison.</p>
<p><strong>4.1 Managed Does NOT Automatically Mean Highly Availabl</strong>e</p>
<p>This is probably one of the easiest things to misunderstand. You create a managed database and think:</p>
<blockquote>
<p>"The cloud provider manages it, so my database is highly available."</p>
</blockquote>
<p>Not necessarily.</p>
<p>For example, Cloud SQL's HA configuration uses a primary and standby across zones, with synchronous replication to persistent disks in both zones.</p>
<p>But you have to configure the HA setup for that protection. Without HA, you can still be dealing with a single database instance failure.</p>
<p>The same idea exists with RDS. Multi-AZ is a specific deployment configuration. Simply using RDS does not mean every database is automatically highly available.</p>
<p>So remember:</p>
<p><em><strong>Managed != HA</strong></em></p>
<p>and</p>
<p><em><strong>Backup != HA</strong></em></p>
<p>A backup helps you recover. HA helps you keep operating when an instance or zone fails. Those are two different problems.</p>
<p><strong>4.2 Your Managed Database Can Still Surprise You on the Bill</strong></p>
<p>People often compare:</p>
<p>VM: ₹X/month<br />Managed DB: ₹Y/month</p>
<p>and stop there.</p>
<p>That comparison is incomplete.</p>
<p>Database cost can include compute, provisioned storage, backups, I/O or network transfer depending on the provider and configuration.</p>
<p>For example, Cloud SQL backup storage is charged separately based on backup usage. Automated backups are incremental, while on-demand backups remain until you manually delete them.</p>
<p>So a database that looks small from the application's perspective can still accumulate additional storage-related costs.</p>
<p>But the opposite mistake is just as common.</p>
<p>A "$20 VM" is not necessarily a "$20 production database" if you also need:</p>
<p>VM + Persistent disk + Backup storage + Monitoring + Replica + Failover setup + Engineering time + Incident response</p>
<p>The last two are especially easy to ignore because they do not necessarily appear on your cloud bill.</p>
<p>And that is one of the biggest traps in this comparison:</p>
<p>You are not only choosing infrastructure cost. You are choosing operational cost.</p>
<p><strong>4.3 Managed Databases Still Have Maintenance Windows</strong></p>
<p>Another common assumption is:</p>
<p>"The provider manages updates, so updates don't affect me."</p>
<p>They can.</p>
<p>Cloud SQL separates infrastructure updates, online updates and maintenance updates. Some maintenance operations involving the operating system or database program can require an instance restart. Google provides scheduling and controls to reduce the impact.</p>
<p>That is still much less work than manually patching and maintaining an entire database server.</p>
<p>But your application should still assume that database connections can disappear.</p>
<p>That means you should have:</p>
<ul>
<li><p>Connection retry logic</p>
</li>
<li><p>Sensible timeouts</p>
</li>
<li><p>Connection pooling</p>
</li>
<li><p>Graceful error handling</p>
</li>
</ul>
<p>The managed service reduces operational work.</p>
<p>It does not eliminate distributed systems problems.</p>
<p><strong>4.4 Self-Hosting Gives You Freedom, Then Charges You for That Freedom</strong></p>
<p>There are legitimate reasons to run PostgreSQL yourself.</p>
<p>Maybe you need:</p>
<ul>
<li><p>A PostgreSQL extension unavailable in the managed service</p>
</li>
<li><p>OS-level access</p>
</li>
<li><p>An unusual filesystem configuration</p>
</li>
<li><p>A specific PostgreSQL build</p>
</li>
<li><p>Deep kernel or database tuning</p>
</li>
<li><p>Complete control over upgrade timing</p>
</li>
</ul>
<p>With a VM, you control the machine.</p>
<p>That is powerful.</p>
<p>It is also exactly why you are responsible for the consequences. AWS even has RDS Custom for situations where customers need privileged OS access or more customization than normal RDS provides.</p>
<p>That tells you something important.</p>
<p>The choice is not always: <strong>Managed vs Self-hosted</strong></p>
<p>Sometimes there is a middle ground.</p>
<p>The better question is: How much control does this workload genuinely require?</p>
<p><strong>4.5 The Scariest Database Problem Isn't Always the Database</strong></p>
<p><strong>GitLab's</strong> famous <strong>2017</strong> database outage is a good example (This is what i got to know while exploring for this article).</p>
<p>GitLab.com was running PostgreSQL with a primary and secondary. During an incident, replication lagged. While engineers were trying to rebuild the secondary, an engineer accidentally deleted data from the primary instead.</p>
<p>The recovery process then exposed another problem.</p>
<p>Their normal backup process was not producing usable backups.</p>
<p>GitLab eventually recovered from an older staging snapshot, losing roughly six hours of database data and spending many hours restoring service.</p>
<p>The lesson is not:</p>
<blockquote>
<p>Self-hosted databases are bad.</p>
</blockquote>
<p>GitLab was operating at a scale and complexity where self-managed PostgreSQL gave them capabilities they needed.</p>
<p>The more uncomfortable lesson is this:</p>
<p><strong>A backup that has never been restored is an assumption, not a recovery strategy.</strong></p>
<p>And this applies to managed databases too.</p>
<p>A cloud provider can automate backups.</p>
<p>You still need to know:</p>
<ul>
<li><p>How long are they retained?</p>
</li>
<li><p>Where are they stored?</p>
</li>
<li><p>What happens during a region failure?</p>
</li>
<li><p>How quickly can you restore?</p>
</li>
<li><p>Can your application reconnect?</p>
</li>
<li><p>Can the data actually be recovered?</p>
</li>
</ul>
<p>Having a backup and having a tested recovery process are not the same thing.</p>
<h3>When Should You Use Which?</h3>
<p>Here is the framework I actually use.</p>
<p>Choose a Managed Database When You are building a normal production application</p>
<p>A common architecture might look like:</p>
<img src="https://cdn.hashnode.com/uploads/covers/65818ce922a2dbe6796da7f5/c743bd84-dc47-4919-b96b-3c9e0e3bc67d.png" alt="" style="display:block;margin:0 auto" />

<p>You probably do not want your development team spending Friday night manually patching PostgreSQL.</p>
<p><strong>Your team is small</strong></p>
<p>If you have three developers, having one of them become the unofficial "Postgres person" can create a serious operational dependency.</p>
<p>The database should support the product.</p>
<p>It should not become a separate job nobody planned for. You need backups and HA without building everything yourself, Managed services provide mechanisms for backups, failover and maintenance. You still need to configure them correctly, but you are not starting from an empty VM.</p>
<p><strong>Consider Self-Hosting When You need deep customization</strong></p>
<p>If the managed service prevents an important database extension or configuration you genuinely need, a VM may make sense.</p>
<p>You already have strong database and infrastructure expertise</p>
<p>If your team already operates PostgreSQL clusters, replication, monitoring, backups and disaster recovery, the operational burden is very different.</p>
<p>The workload is unusual</p>
<p>Some specialized workloads simply do not fit neatly inside the constraints of managed services.</p>
<p>You have a clear reason for the control</p>
<p>This is the important part.</p>
<p>Do not choose self-hosting because:</p>
<blockquote>
<p>The VM is cheaper.</p>
</blockquote>
<p>Choose it because:</p>
<blockquote>
<p>We need something the managed service cannot provide, and we are prepared to operate it.</p>
</blockquote>
<p>That is a very different argument.</p>
<h3><strong>A Simple Decision Framework</strong></h3>
<img src="https://cdn.hashnode.com/uploads/covers/65818ce922a2dbe6796da7f5/548f4f00-f86a-4b98-befe-104f32bd894b.png" alt="" style="display:block;margin:0 auto" />

<p>The mistake is starting with:</p>
<p>"Which one is cheaper?"</p>
<p>Start with:</p>
<p>"Which operational responsibilities am I willing to own?"</p>
<p>Then calculate the cost.</p>
<h3>The Real-World Lesson</h3>
<p>GitLab's 2017 incident is a useful reminder that database architecture is about much more than choosing PostgreSQL versus MySQL or VM versus managed service.</p>
<ul>
<li><p>Their system had replication.</p>
</li>
<li><p>They had backups.</p>
</li>
<li><p>They had snapshots.</p>
</li>
<li><p>They had engineers.</p>
</li>
</ul>
<p>And yet the recovery process still failed because the pieces did not work together reliably when they were actually needed.</p>
<p>That distinction matters.</p>
<p>A production database is not just:</p>
<p>Database -&gt; Store Data</p>
<p>A managed database takes several of those boxes away from you. A VM gives those boxes back to you. Neither architecture magically makes them disappear.</p>
]]></content:encoded></item><item><title><![CDATA[SQL vs NoSQL: How Cloud Changed the Database Decision]]></title><description><![CDATA[The interesting database question isn't “SQL or NoSQL?”
It's “What kind of pain am I willing to own?”
Because in the Cloud, you get SQL that scales across regions, NoSQL that supports transactions, se]]></description><link>https://therootaddress.hashnode.dev/sql-vs-nosql-how-cloud-changed-the-database-decision</link><guid isPermaLink="true">https://therootaddress.hashnode.dev/sql-vs-nosql-how-cloud-changed-the-database-decision</guid><category><![CDATA[Cloud]]></category><category><![CDATA[Cloud Computing]]></category><category><![CDATA[SQL]]></category><category><![CDATA[NoSQL]]></category><dc:creator><![CDATA[Aman Singh]]></dc:creator><pubDate>Sat, 26 Sep 2026 05:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/65818ce922a2dbe6796da7f5/c327d0af-9a82-470b-9c20-8a6e71e8b929.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The interesting database question isn't “SQL or NoSQL?”</p>
<p>It's “What kind of pain am I willing to own?”</p>
<p>Because in the Cloud, you get SQL that scales across regions, NoSQL that supports transactions, serverless databases that charge per operation, and managed relational databases that still make you think about connection limits.</p>
<p>The old database debate didn't disappear.</p>
<p>The cloud just moved the boundaries.</p>
<h3>The Problem We Used to Have</h3>
<p>For a long time, the database decision was presented almost like a personality test. Need relationships, joins, transactions and a rigid schema?</p>
<p><em>Pick SQL.</em></p>
<p>Need flexible documents, massive scale and high write throughput?</p>
<p><em>Pick NoSQL.</em></p>
<p>That explanation isn't completely wrong. It's just increasingly incomplete.</p>
<p>The original problem was much more physical.</p>
<p>A traditional relational database was commonly running on a machine or a relatively small cluster. When the workload grew, you could scale the machine vertically with more CPU, RAM and storage but eventually you hit the limits of that machine.</p>
<p>Horizontal scaling was much harder.</p>
<p>Splitting relational data across machines introduces problems that are easy to underestimate: distributed transactions, coordination, replication, consistency and query routing.</p>
<p>NoSQL systems emerged partly from this world.</p>
<p>Instead of preserving every relational abstraction, many systems optimized around specific access patterns and distributed workloads.</p>
<blockquote>
<p>But cloud providers changed this equation.</p>
</blockquote>
<p>They started taking the operational burden away from developers, The replication, failover, storage management, partitioning, backups and capacity management could increasingly become someone else's problem.</p>
<p>And eventually, something more interesting happened:</p>
<blockquote>
<p><em>SQL itself became distributed.</em></p>
</blockquote>
<p><strong>Google Spanner</strong> is a good example. It partitions tables into key ranges called <em>splits</em>, replicates them across failure domains and uses distributed coordination while still exposing a SQL interface and strong transactional guarantees.</p>
<p>So today, the database decision isn't simply about whether your data is relational.</p>
<p>It's about workload shape, consistency requirements, access patterns, operational model and cost.</p>
<h2>What SQL and NoSQL Actually Mean in the Cloud</h2>
<p>At the application level, SQL still gives you a relational model.</p>
<p>You have tables, relationships, constraints and a query language designed around asking questions about data.</p>
<p>A managed PostgreSQL database such as Cloud SQL doesn't make PostgreSQL fundamentally different. Google manages infrastructure around it, but your application still interacts with a relational database.</p>
<p>That's extremely useful when your application naturally thinks in relationships:</p>
<p><code>SELECT orders.id, customers.email FROM orders JOIN customers ON orders.customer_id = customers.id WHERE customers.id = 42;</code></p>
<p>You don't have to manually reconstruct that relationship in application code.</p>
<p>NoSQL takes a different approach.</p>
<p>Consider <em>DynamoDB (AWS one).</em></p>
<p>Instead of designing the database around arbitrary relational queries, you generally begin with a much more uncomfortable question:</p>
<p><code>What queries will my application need to perform?</code></p>
<p>AWS's own documentation describes single-table design around access patterns and data locality rather than traditional normalized relational modeling.</p>
<p>That difference is bigger than syntax.</p>
<p>With relational databases, developers often design the schema first and queries second. With systems such as DynamoDB, your access patterns can become part of the schema design itself.</p>
<p>That's one of the biggest conceptual shifts cloud NoSQL introduces.</p>
<p>How Developers Actually Use the Two</p>
<p>Imagine we're building a SaaS application.</p>
<p>We have:</p>
<ul>
<li><p><em>users</em></p>
</li>
<li><p><em>organizations</em></p>
</li>
<li><p><em>projects</em></p>
</li>
<li><p><em>subscriptions</em></p>
</li>
<li><p><em>invoices</em></p>
</li>
<li><p><em>audit logs</em></p>
</li>
</ul>
<p>With PostgreSQL, a fairly natural design might be:</p>
<p><code>CREATE TABLE users ( id BIGSERIAL PRIMARY KEY, email TEXT UNIQUE NOT NULL );</code></p>
<p><code>CREATE TABLE projects (</code><br /><code>id BIGSERIAL PRIMARY KEY,</code><br /><code>organization_id BIGINT NOT NULL,</code><br /><code>name TEXT NOT NULL );</code></p>
<p>Now we can query relationships naturally:</p>
<p><code>SELECT p.name, u.email FROM projects</code><br /><code>p JOIN organizations o</code><br /><code>ON p.organization_id = o.id JOIN users u ON u.id = o.owner_id</code><br /><code>WHERE o.id = 42;</code></p>
<p>This model is powerful because the database understands relationships.</p>
<p>Now imagine the same product using DynamoDB.</p>
<p>Instead of starting with:</p>
<blockquote>
<p>"What entities should I normalize?"</p>
</blockquote>
<p>you might start with:</p>
<p>"What requests does the application make?"</p>
<p>For example:</p>
<p><code>PK = ORG#42 SK = PROJECT#1001</code></p>
<p>Another item could be:</p>
<p><code>PK = ORG#42 SK = USER#918</code></p>
<p>Now a single partition-key query can retrieve related entities efficiently. The database model is being shaped around how the application reads data.</p>
<p>That's powerful.</p>
<p>But it also means you have to think differently.</p>
<blockquote>
<p><em>What Most Tutorials won't Tell You</em></p>
</blockquote>
<h3>“Serverless database” doesn't mean “free when idle”</h3>
<p>This is one of the easiest cloud assumptions to make.</p>
<p>Firestore, for example, bills based on operations including document reads, writes and deletes. More importantly, some queries can incur index-entry read charges, and every query has a minimum charge of one document read even when it returns no documents.</p>
<p>There's another particularly nasty detail:</p>
<p>Using an offset for pagination can charge you for the documents you skipped.</p>
<p>If your query skips 10 documents and returns one, Firestore can charge for 11 reads. That's why cursor-based pagination isn't just a performance technique.</p>
<p>It can also be a billing technique. The cloud has made databases easier to provision. It hasn't made database economics disappear.</p>
<h3>NoSQL can move complexity from the database into your architecture</h3>
<p>DynamoDB can scale without you managing traditional database servers, but that doesn't mean the data model becomes simpler. AWS explicitly documents single-table design as a pattern based around access patterns and relationships between different entity types.</p>
<p>That's the trade.</p>
<p>PostgreSQL might let you ask a new question tomorrow:</p>
<p><code>SELECT ...</code><br /><code>FROM ...</code><br /><code>JOIN ...</code><br /><code>WHERE ...</code></p>
<p>A DynamoDB design may require you to have anticipated that access pattern and modeled keys or indexes accordingly. So NoSQL can remove one category of operational complexity while introducing another:</p>
<p><strong>schema flexibility does not mean query flexibility.</strong></p>
<h3>A 400 KB limit can suddenly become an architectural decision</h3>
<p>DynamoDB has a maximum item size of 400 KB, including attribute names and values.</p>
<p>That sounds enormous until someone decides to store:</p>
<ul>
<li><p>large JSON documents</p>
</li>
<li><p>generated content</p>
</li>
<li><p>metadata</p>
</li>
<li><p>nested objects</p>
</li>
<li><p>conversation history</p>
</li>
</ul>
<p>inside a single item.</p>
<p>Suddenly, the database's data model is influencing the application architecture.</p>
<p>Maybe you split the object. Maybe you move large payloads to S3. Maybe you redesign the access pattern.</p>
<p>The important lesson isn't memorizing “400 KB.”</p>
<p><strong>It's realizing that managed doesn't mean unconstrained.</strong></p>
<h3>Distributed SQL is no longer an oxymoron</h3>
<p>This is probably the biggest reason the old SQL-vs-NoSQL debate feels outdated.</p>
<p><strong>Spanner</strong> provides SQL while distributing data across machines and regions. It uses replication and distributed transactions while maintaining strong consistency.</p>
<p>That means the question:</p>
<blockquote>
<p>I need massive scale, therefore I can't use SQL.</p>
</blockquote>
<p>is no longer automatically true.</p>
<p>But there's a catch.</p>
<p>Spanner isn't simply “PostgreSQL, but bigger.”</p>
<p>You're buying a distributed database architecture.</p>
<p>Its pricing can include compute, database storage, backup storage, replication and network usage. Multi-region configurations can therefore have substantially different economics from a small regional PostgreSQL deployment.</p>
<p>So the cloud didn't eliminate trade-offs.</p>
<p><strong>It gave us more sophisticated trade-offs.</strong></p>
<h2>The Real Decision Framework</h2>
<p>Instead of asking:</p>
<blockquote>
<p>SQL or NoSQL?</p>
</blockquote>
<p>Ask these questions.</p>
<ol>
<li><strong>How relational is the problem?</strong></li>
</ol>
<p>If your application naturally contains relationships, joins, constraints and multi-row transactions, relational databases are usually a natural starting point.</p>
<p>If most requests look like:</p>
<p>Give me item X<br />Give me all events for user Y<br />Give me the latest N records for device Z</p>
<p>a key-value/document model may fit better.</p>
<ol>
<li><strong>Do you know your access patterns?</strong></li>
</ol>
<p>If your query requirements are predictable, a system like DynamoDB can be extremely effective.</p>
<p>If your product is still changing rapidly and you expect developers to invent new queries every week, relational querying can provide more flexibility.</p>
<p>This is why “NoSQL has no schema” is misleading.</p>
<p>There is still a model.</p>
<p>It may simply be encoded more heavily in keys, <em>indexes and application access patterns.</em></p>
<ol>
<li><strong>How much consistency do you actually need?</strong></li>
</ol>
<p>A banking transaction and a social-media like are not the same workload.</p>
<p>Some systems can tolerate stale or eventually consistent data.</p>
<p>Others cannot. And modern databases offer more nuance than simply:</p>
<p>SQL = strong NoSQL = eventual</p>
<p>For example, Spanner provides external consistency by default and supports transactional semantics across distributed data. DynamoDB also supports eventually consistent, strongly consistent and transactional reads, with different consumption characteristics.</p>
<p>The real question is:</p>
<p><em>What consistency does this particular operation require?</em></p>
<ol>
<li><strong>What happens when traffic becomes unpredictable?</strong></li>
</ol>
<p>This is where cloud-native databases become particularly interesting.</p>
<p>DynamoDB's on-demand mode charges based on consumed requests and automatically handles capacity management, while provisioned mode requires you to specify read/write capacity.</p>
<p>That changes the operational calculation.</p>
<p>You're no longer just choosing a database engine.</p>
<p>You're choosing how much capacity management you want your team to own.</p>
<h3>A Real Example: Uber</h3>
<p>Uber's database evolution is a good reminder that these decisions rarely happen in isolation.</p>
<p>In 2014, Uber's core trip data was running into storage limitations with PostgreSQL as trip volume grew.</p>
<p>Uber eventually built Schemaless, a custom datastore using sharded MySQL underneath. The system used an append-only architecture, buffered writes, replication-related mechanisms and global indexes to meet its scalability and availability requirements.</p>
<p>Notice what happened.</p>
<p>Uber didn't simply say:</p>
<blockquote>
<p>PostgreSQL is bad, let's use NoSQL.</p>
</blockquote>
<p>They identified a specific set of requirements that the existing architecture wasn't meeting at the required scale and built an architecture around those requirements.</p>
<p>That's the important lesson.</p>
<p>The database choice was an engineering response to workload constraints, not a religious preference for SQL or NoSQL.</p>
<h3>The Cloud Changed the Question</h3>
<p>The old question was:</p>
<blockquote>
<p>Which database is better?</p>
</blockquote>
<p>The better question is:</p>
<blockquote>
<p>Which failure mode, consistency model, scaling model and cost model fits this workload?</p>
</blockquote>
<p>Cloud databases have blurred the old boundaries.</p>
<p>You can have:</p>
<p><strong>SQL + distributed scale</strong></p>
<p>with systems such as Spanner.</p>
<p>You can have:</p>
<p><strong>NoSQL + transactions</strong></p>
<p>with systems such as DynamoDB and Firestore.</p>
<p>You can have:</p>
<p><strong>managed PostgreSQL</strong></p>
<p>without managing the underlying database servers yourself.</p>
<p>And you can have:</p>
<p><strong>serverless billing</strong></p>
<p>where a badly designed query becomes a cost problem rather than merely a performance problem.</p>
<p>So when you're choosing a database for your next cloud application, don't start with:</p>
<blockquote>
<p>SQL vs NoSQL?</p>
</blockquote>
<p>Start with:</p>
<blockquote>
<p>What does my application need to do, how must it behave under failure, and how will I pay for that behavior at 10× the traffic?</p>
</blockquote>
<p>That's a much harder question.</p>
<p>But it's also the one that actually matters.</p>
]]></content:encoded></item></channel></rss>