<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Paras nagpal on Medium]]></title>
        <description><![CDATA[Stories by Paras nagpal on Medium]]></description>
        <link>https://medium.com/@paras.nagpal743?source=rss-369f1ec793a0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*8UqckRhz-GbGIxqoCV7K6A.jpeg</url>
            <title>Stories by Paras nagpal on Medium</title>
            <link>https://medium.com/@paras.nagpal743?source=rss-369f1ec793a0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 11:02:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@paras.nagpal743/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Aerospike Architecture — A Practical Guide for Backend Engineers]]></title>
            <link>https://medium.com/@paras.nagpal743/aerospike-architecture-a-practical-guide-for-backend-engineers-5e96d0f5e659?source=rss-369f1ec793a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e96d0f5e659</guid>
            <category><![CDATA[aerospike]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Paras nagpal]]></dc:creator>
            <pubDate>Sat, 14 Mar 2026 19:24:10 GMT</pubDate>
            <atom:updated>2026-03-14T20:18:13.395Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KaAym75PUa5kUPxt8v4x6A.jpeg" /><figcaption>Cluster Architecture</figcaption></figure><p>Modern real-time systems often need <strong>millions of requests per second</strong>, <strong>sub-millisecond latency</strong>, and <strong>terabytes of data</strong>. Traditional databases struggle to satisfy all three simultaneously.</p><p>This is where <strong>Aerospike</strong> comes in.</p><p>Aerospike is a <strong>distributed key-value database designed for real-time systems at massive scale</strong>. It is widely used in domains like:</p><ul><li>Ad-tech bidding platforms</li><li>Fraud detection systems</li><li>Recommendation engines</li><li>Session stores</li><li>Real-time personalization</li></ul><p>This article explains <strong>how Aerospike works internally</strong>, its <strong>core architecture</strong>, and how it compares with systems like <strong>Redis, Cassandra, and DynamoDB</strong>.</p><h3>Why Aerospike Exists</h3><p>Real-time systems often have requirements like:</p><pre>Millions of reads per second<br>Sub-millisecond latency<br>Terabytes of data<br>Horizontal scalability</pre><p>Traditional solutions struggle:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PCLzfPnNRJLyRtYux3-Hxg.png" /></figure><p>Aerospike was designed specifically to solve this <strong>high-throughput + low-latency + large dataset</strong> problem.</p><h3>Core Idea Behind Aerospike</h3><p>The key architectural trick in Aerospike is:</p><pre>RAM → Primary index<br>SSD → Actual data</pre><p>Most databases either store everything in <strong>RAM</strong> or everything on <strong>disk</strong>. Aerospike separates the two.</p><h3>Lookup flow</h3><pre>Key<br> ↓<br>Hash(key)<br> ↓<br>RAM index lookup<br> ↓<br>Direct SSD read<br> ↓<br>Return record</pre><p>This means every request requires:</p><pre>1 RAM lookup<br>1 SSD read</pre><p>Which keeps latency extremely predictable.</p><h3>Why This Is Powerful</h3><p>Consider storing a dataset of <strong>400 GB</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D2t3eM4O8jHrcqOSdeNidg.png" /></figure><p>Aerospike reduces RAM requirements dramatically while still keeping latency very low.</p><p>This makes it economically viable to store <strong>multi-terabyte datasets</strong>.</p><h3>Primary Index in RAM</h3><p>Aerospike stores an <strong>index entry per record in memory</strong>.</p><p>Typical index size:</p><pre>~64–100 bytes per record</pre><p>So RAM usage depends on <strong>number of records</strong>, not the <strong>size of records</strong>.</p><p>Example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y7-uUlaPaBAf71Lj8W1K9A.png" /></figure><p>This design allows very large datasets on SSD while keeping RAM usage manageable.</p><h3>Partitioning Model</h3><p>Aerospike divides data into a fixed number of partitions:</p><pre>4096 partitions per namespace</pre><p>Every key is mapped to a partition using hashing.</p><pre>partition_id = hash(key) % 4096</pre><p>Example:</p><pre>user123 → partition 1523<br>user456 → partition 391</pre><p>These partitions are distributed across nodes in the cluster.</p><p>Example cluster with 4 nodes:</p><pre>Node A → 1024 partitions<br>Node B → 1024 partitions<br>Node C → 1024 partitions<br>Node D → 1024 partitions</pre><p>When nodes are added or removed, <strong>entire partitions move</strong>, which makes cluster rebalancing very fast.</p><h3>Replication Model</h3><p>Aerospike provides high availability using <strong>replication</strong>.</p><p>Example with replication factor = 2 :</p><pre>Partition 100<br>Master  → Node A<br>Replica → Node C</pre><p>If Node A fails:</p><pre>Partition 100<br>Master → Node C</pre><p>The replica is automatically promoted to master.</p><p>The cluster then rebuilds a new replica to restore the replication factor.</p><h3>Single-Hop Architecture</h3><p>One of the most interesting aspects of Aerospike is how the client knows <strong>where to send requests</strong>.</p><p>When a client connects to an Aerospike cluster, it retrieves cluster metadata that contains the mapping between <strong>partitions and nodes</strong>. This mapping is called the <strong>partition map</strong>.</p><p>Using the partition map, the client knows exactly which node owns the partition responsible for a given key.</p><p>The request flow becomes:</p><pre>Client request<br> ↓<br>hash(key)<br> ↓<br>determine partition<br> ↓<br>consult partition map<br> ↓<br>send request directly to correct node</pre><p>Because the client can directly contact the correct node, there is <strong>no need for a routing or coordinator node</strong>.</p><p>This architecture is known as <strong>single-hop architecture</strong>, and it significantly reduces network overhead and latency.</p><p>If the cluster topology changes (for example when a node fails or a new node joins), the partition map is updated and clients refresh their metadata automatically.</p><h3>Storage Engine</h3><p>Aerospike typically runs in <strong>hybrid memory mode</strong>:</p><pre>Index → RAM<br>Data  → SSD/NVMe</pre><p>Modern NVMe SSDs support extremely high parallel I/O:</p><pre>500K+ IOPS<br>microsecond latency<br>thousands of concurrent operations</pre><p>This allows Aerospike to handle <strong>millions of requests per second</strong>.</p><h3>Aerospike Data Model</h3><p>Aerospike uses a simple hierarchical data model.</p><h3>Namespace</h3><p>Top-level container for data.</p><p>Equivalent to:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EpIvZuVf4Z2dMWvx8QGFKA.png" /></figure><p>Example:</p><pre>namespace: users<br>namespace: sessions</pre><p>Each namespace has its own configuration:</p><ul><li>replication factor</li><li>storage engine</li><li>memory allocation</li><li>TTL policies</li></ul><h3>Set</h3><p>A set is a logical grouping of records inside a namespace.</p><p>Equivalent to:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RHj-DhgoCRLrRhE4g56ZBg.png" /></figure><p>Example:</p><pre>namespace: users<br>set: profiles</pre><h3>Record</h3><p>A record is a key-value entry.</p><p>Equivalent to:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m9Hlb6DmTs4xqd1G5YP2sA.png" /></figure><p>Example:</p><pre>Key: user123</pre><h3>Bins</h3><p>Bins are fields inside a record.</p><p>Equivalent to:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BfqNWWY3q2e4HKru-45DWQ.png" /></figure><p>Example record:</p><pre>Key: user123</pre><pre>Bins:<br>name = &quot;Paras&quot;<br>age = 25<br>city = &quot;Delhi&quot;</pre><p>Records can also include metadata such as:</p><pre>TTL<br>generation<br>last update time</pre><h3>Built-in TTL Support</h3><p>Aerospike supports automatic expiration.</p><p>Example:</p><pre>Key: session_abc<br>TTL = 1800 seconds</pre><p>After 30 minutes, the record automatically expires.</p><p>This makes Aerospike ideal for:</p><ul><li>session stores</li><li>caches</li><li>short-lived real-time data</li></ul><h3>Aerospike vs Redis</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*epudVa-TVnrRX-zpN9fqng.png" /></figure><p>Redis works best as a <strong>cache</strong>, while Aerospike works as a <strong>large real-time datastore</strong>.</p><h3>Aerospike vs Cassandra</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x9eMBvfgQxpPasvtIV6dIA.png" /></figure><p>Cassandra is excellent for <strong>write-heavy analytical workloads</strong>, while Aerospike excels in <strong>real-time key-value access</strong>.</p><h3>Aerospike vs DynamoDB</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ss2680SWyNS3ucBoVdcXNQ.png" /></figure><p>DynamoDB is easier to operate in cloud environments, while Aerospike offers <strong>maximum performance and control</strong>.</p><h3>Common Real-World Use Cases</h3><p>Aerospike is widely used in:</p><p><strong>Ad-Tech</strong></p><pre>real-time ad bidding<br>user targeting<br>frequency capping</pre><p><strong>Fraud Detection</strong></p><pre>card risk scoring<br>transaction validation<br>real-time decision engines</pre><p><strong>User Personalization</strong></p><pre>recommendation systems<br>profile lookups<br>behavior tracking</pre><p><strong>Session Stores</strong></p><pre>authentication tokens<br>short-lived session data</pre><h3>Final Takeaway</h3><p>The core architectural insight behind Aerospike is simple but powerful:</p><pre>Keep the index in RAM<br>Store the data on SSD<br>Use partitioned distributed architecture</pre><p>This design allows Aerospike to deliver:</p><pre>sub-millisecond latency<br>millions of requests per second<br>terabytes of data<br>horizontal scalability</pre><p>Which makes it one of the best databases for <strong>real-time large-scale systems</strong>.</p><p>If you’re building systems that require <strong>extreme throughput and low latency at scale</strong>, Aerospike is definitely worth understanding.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e96d0f5e659" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>