<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Database on Yutong Jin</title><link>https://yutongjin.com/tags/database/</link><description>Recent content in Database on Yutong Jin</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 19 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://yutongjin.com/tags/database/index.xml" rel="self" type="application/rss+xml"/><item><title>Relational DB vs NoSQL</title><link>https://yutongjin.com/posts/419_learning/</link><pubDate>Sun, 19 Apr 2026 00:00:00 +0000</pubDate><guid>https://yutongjin.com/posts/419_learning/</guid><description>&lt;h2 id="relational-db-vs-nosql--interview-answer-template-with-qps-details"&gt;Relational DB vs NoSQL — Interview Answer Template (with QPS Details)&lt;/h2&gt;
&lt;h3 id="1-throughput--scalability"&gt;1. Throughput &amp;amp; Scalability&lt;/h3&gt;
&lt;p&gt;A relational database like MySQL can handle moderate QPS well.&lt;/p&gt;
&lt;h4 id="rough-numbers-rule-of-thumb-varies-by-setup"&gt;Rough Numbers (rule of thumb, varies by setup):&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Single MySQL instance&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;~1K – 5K QPS (typical production range)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;With read replicas&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Reads can scale to &lt;strong&gt;10K+ QPS&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;With sharding&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Can scale to &lt;strong&gt;100K+ QPS&lt;/strong&gt;, depending on number of shards&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;However, sharding introduces additional complexity:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Choosing a good shard key&lt;/li&gt;
&lt;li&gt;Avoiding hotspot partitions&lt;/li&gt;
&lt;li&gt;Handling cross-shard queries&lt;/li&gt;
&lt;li&gt;Rebalancing data&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="example-tradeoffs"&gt;Example Tradeoffs:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Shard by userId&lt;/strong&gt;&lt;/p&gt;</description></item></channel></rss>