<?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 VP on Medium]]></title>
        <description><![CDATA[Stories by VP on Medium]]></description>
        <link>https://medium.com/@vinay.paix?source=rss-66189379b642------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*d1oWibpZlzGRgqe9</url>
            <title>Stories by VP on Medium</title>
            <link>https://medium.com/@vinay.paix?source=rss-66189379b642------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 06:36:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vinay.paix/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[Stop Counting Nodes: The Cassandra Sizing Debate Nobody Talks About]]></title>
            <link>https://medium.com/@vinay.paix/stop-counting-nodes-the-cassandra-sizing-debate-nobody-talks-about-a2597364a3bb?source=rss-66189379b642------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2597364a3bb</guid>
            <category><![CDATA[nosql-database]]></category>
            <category><![CDATA[apache-cassandra]]></category>
            <dc:creator><![CDATA[VP]]></dc:creator>
            <pubDate>Thu, 27 Aug 2026 04:09:00 GMT</pubDate>
            <atom:updated>2026-08-27T04:09:00.844Z</atom:updated>
            <content:encoded><![CDATA[<p>Co authored by Vinay Pai and Suresh Achuthan Nair</p><p><strong>Introduction</strong></p><p>Every modern application wants three things simultaneously — consistent speed, availability, and infinite scalability. Unfortunately, distributed systems don’t let us have everything at once. Every database is forced to make architectural trade-offs. Cassandra was built with one very specific philosophy and understanding that philosophy is the key to designing a cluster that performs well in production.</p><p><strong>CAP Theorem: The Fundamental Trade-off of Distributed Databases</strong></p><p>Imagine an e-commerce platform processing millions of orders every hour across data centres in New York, London, Singapore, and Mumbai. Every customer expects the same product inventory, the same account balance, and the same order status regardless of where they connect from. At first glance, this seems straightforward — simply replicate the data across all locations. However, distributed computing introduces a harsh reality: networks fail. Communication links become congested, data centres lose connectivity, servers crash, and entire regions may become temporarily isolated. These events, known as <strong>network partitions</strong>, are not hypothetical — they are inevitable in every large-scale distributed system.</p><p>This is precisely the problem that the <strong>CAP Theorem</strong> attempts to address. The CAP theorem states that <strong>a distributed data system cannot simultaneously guarantee Consistency, Availability, and Partition Tolerance when a network partition occurs</strong>. During such an event, the system must sacrifice either consistency or availability while continuing to tolerate the partition.</p><p>Rather than being a limitation of a particular database, CAP is a fundamental law governing distributed systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*Vc7vtWQOTcYEcTAZAmdz8g.png" /><figcaption>CAP Theorem</figcaption></figure><p><strong>The Three Pillars of CAP</strong></p><p><strong>Consistency ©</strong></p><p>Consistency guarantees that every client observes the same data at the same point in time.</p><p>Whenever a write operation completes successfully, every subsequent read should immediately return the latest committed value regardless of which node serves the request.</p><p>For example, consider an online banking application. A customer transfers USD 1,000 from their savings account. Immediately after the transaction completes, every ATM, mobile application, branch portal, and internet banking service must display the updated balance. Returning an outdated balance could lead to incorrect financial decisions or even duplicate withdrawals.</p><p>Strong consistency is therefore essential in systems where correctness is more important than latency.</p><p><strong>Advantages</strong></p><ul><li>Guarantees data correctness</li><li>Eliminates stale reads</li><li>Simplifies application logic</li><li>Essential for financial and transactional workloads</li></ul><p><strong>Disadvantages</strong></p><ul><li>Higher latency</li><li>Additional coordination between replicas</li><li>Temporary service interruptions during failures</li></ul><p><strong>Availability (A)</strong></p><p>Availability ensures that every request receives a response, even if some nodes within the cluster are unavailable.</p><p>Importantly, CAP defines availability as the system always responding — not necessarily returning the latest version of the data.</p><p>Imagine a global social media platform. During a regional outage, users still expect to browse posts, upload photos, or send messages. Returning slightly outdated information is generally preferable to displaying an error page.</p><p>This design philosophy prioritizes uninterrupted service over immediate consistency.</p><p><strong>Advantages</strong></p><ul><li>Continuous service</li><li>Excellent user experience</li><li>High fault tolerance</li><li>Minimal downtime</li></ul><p><strong>Disadvantages</strong></p><ul><li>Users may observe stale data</li><li>Replicas require time to synchronize</li><li>Temporary inconsistencies can occur</li></ul><p><strong>Partition Tolerance (P)</strong></p><p>Partition tolerance refers to the system’s ability to continue operating despite communication failures between nodes.</p><p>A partition occurs whenever two or more groups of servers become unable to communicate, even though each group may continue functioning independently.</p><p>For example, imagine a Cassandra cluster spread across three AWS regions:</p><ul><li>US-East</li><li>Europe</li><li>Asia-Pacific</li></ul><p>If the network link between Europe and the remaining regions fails, each region continues running independently. The system has experienced a partition.</p><p>The database must now decide:</p><ul><li>Should it continue accepting requests independently in each region?</li><li>Or should it reject requests until communication is restored?</li></ul><p>This decision represents the core trade-off described by CAP.</p><p>Unlike consistency and availability, <strong>partition tolerance is not optional</strong>. In any sufficiently large distributed system, network failures will eventually occur. Architects therefore design systems assuming partitions are inevitable rather than exceptional.</p><p><strong>Why Partition Tolerance Is Non-Negotiable</strong></p><p>Many newcomers interpret CAP as choosing any two of the three properties. While this is a useful teaching simplification, it can be misleading.</p><p>In practice, distributed databases cannot simply ignore partition tolerance. Once a database spans multiple machines, racks, availability zones, or geographic regions, communication failures become unavoidable. Hardware fails, routers malfunction, cables are damaged, and cloud providers occasionally experience regional outages.</p><p>Consequently, every modern distributed database — including Cassandra, MongoDB, CockroachDB, DynamoDB, HBase etc — is inherently partition tolerant.</p><p>The real architectural question is therefore not:</p><p><strong>Consistency vs Availability vs Partition Tolerance. </strong>Instead, it becomes: <strong>When a partition occurs, should the system prioritise Consistency or Availability?</strong></p><p>This subtle distinction is what truly defines the design philosophy of distributed databases.</p><p>Consider a distributed inventory database containing the stock level for a popular smartphone.</p><p>Initially, every replica stores the same value:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/199/1*8OFiqujFjH_fQheyEmSC6w.png" /></figure><p>Now assume a customer purchases the last unit through Node A. Before this update can propagate, the network connection between Node A and the remaining nodes fail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*DVJ7I1DFXD_-dtjR0EJlAg.png" /></figure><p>At this point, the database has two choices.</p><p><strong>Option 1: Prioritise Consistency (CP)</strong></p><p>Node A refuses additional requests until it can synchronise with the other replicas.</p><p>Every client either sees the latest inventory count or receives an error indicating that the service is temporarily unavailable.</p><p>The data remains perfectly consistent, but availability decreases.</p><p><strong>Option 2: Prioritise Availability (AP)</strong></p><p>All nodes continue serving requests independently.</p><p>Some customers may temporarily see an inventory count of <strong>100</strong>, while others see <strong>99</strong>.</p><p>Although the system remains available, the replicas will eventually reconcile their differences once network connectivity is restored.</p><p>This behaviour is known as <strong>eventual consistency</strong>.</p><p><strong>Why Cassandra is Different: Engineering for Always-On Systems</strong></p><p>We have established that every distributed database must make a conscious architectural choice when faced with the realities of the CAP theorem. Some databases choose <strong>Consistency (CP)</strong>, ensuring that every client always reads the latest data, even if that means temporarily denying requests during failures. Others choose <strong>Availability (AP)</strong>, ensuring that the system continues to serve requests despite network failures, accepting that data may be temporarily inconsistent.</p><p>Apache Cassandra belongs to the latter category — but that alone does not explain why it has become the database of choice for organizations such as Netflix, Apple, Uber, Instagram, Discord, and countless IoT platforms. Its real strength lies not only in being an AP database, but in the innovative architectural decisions that enable it to scale horizontally, remain operational during failures, and support geographically distributed applications with remarkable efficiency.</p><p>Unlike traditional relational databases or even many NoSQL databases, Cassandra was designed from the ground up with one objective: <strong>there should never be a single point of failure</strong>.</p><p><strong>A Truly Peer-to-Peer Architecture</strong></p><p>One of Cassandra’s defining characteristics is its <strong>peer-to-peer architecture</strong>.</p><p>Most traditional database systems follow a <strong>master-slave</strong> or <strong>primary-replica</strong> model. In such systems, a designated master node is responsible for accepting write operations, while one or more replica nodes receive updates from the master. Although this model simplifies coordination, it introduces a significant weakness: the master becomes the most critical component of the entire system.</p><p>If the master node fails, another replica must be elected as the new master before the system can resume normal operation. During this election process, applications may experience increased latency or even temporary downtime.</p><p>Cassandra eliminates this bottleneck entirely.</p><p>Every node in a Cassandra cluster is identical. There is no master node, no leader election process, and no central coordinator responsible for managing the cluster. Every node is capable of accepting both read and write requests, and every node participates equally in storing and serving data.</p><p>This peer-to-peer design removes single points of failure and significantly improves the resilience of the database.</p><p><strong>Traditional Master-Replica vs Cassandra</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/364/1*dKY988Bvl_kjhSogXP1tIw.png" /></figure><p><strong>Built for Multi-Region Deployments</strong></p><p>Modern applications rarely serve users from a single location.</p><p>A global e-commerce platform may have customers in North America, Europe, Asia, and Australia simultaneously. Similarly, financial services, gaming platforms, streaming services, and IoT solutions often operate across multiple continents.</p><p>Cassandra was designed with this reality in mind.</p><p>Its architecture naturally supports <strong>multiple data centres and multiple geographic regions</strong>. Data can be replicated across regions while allowing applications to read from their nearest data centre, thereby reducing latency and improving user experience.</p><p>For example, a customer in Singapore can retrieve data from the Singapore data centre, while another customer in Frankfurt accesses the same dataset from Europe. Behind the scenes, Cassandra ensures that replicas remain synchronised according to the configured consistency level.</p><p>Unlike many databases that treat geo-replication as an optional add-on, Cassandra incorporates it as a fundamental capability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*3lrw-xqSPTYNiW1xOdSz-Q.png" /></figure><p><strong>Designed to Survive Failures</strong></p><p>Hardware failures are inevitable.</p><p>Disks fail, network switches malfunction, virtual machines crash, and sometimes entire availability zones become unavailable.</p><p>Many traditional database systems require manual intervention or failover procedures before applications can continue processing requests.</p><p>Cassandra takes a fundamentally different approach.</p><p>Since every piece of data is replicated across multiple nodes, the loss of a single node — or even multiple nodes, depending on the replication factor — does not interrupt application availability.</p><p>If one node becomes unavailable, another replica automatically serves the request. When the failed node eventually rejoins the cluster, Cassandra synchronises the missing data using mechanisms such as hinted handoff, read repair, and anti-entropy repair.</p><p>From an application’s perspective, the failure may be almost invisible.</p><p>This design makes Cassandra particularly suitable for systems where downtime translates directly into financial loss or poor customer experience.</p><p><strong>Linear Scalability</strong></p><p>Scaling traditional databases is often difficult.</p><p>As application traffic increases, organisations usually upgrade to larger and more powerful servers. This approach, known as <strong>vertical scaling</strong>, eventually reaches hardware limits and becomes increasingly expensive.</p><p>Cassandra adopts a completely different strategy.</p><p>It scales <strong>horizontally</strong>.</p><p>Whenever additional capacity is required, architects simply add more nodes to the cluster. Cassandra automatically redistributes data across the new nodes, allowing storage capacity, throughput, and processing power to grow almost proportionally.</p><p>For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/1*PC65v-fKUjh8tVfOrzwcxw.png" /></figure><p>Similarly, if one cluster can process one million writes per second using ten nodes, adding ten more nodes can approximately double the write throughput, assuming the workload is evenly distributed.</p><p>This characteristic is known as <strong>linear scalability</strong>, and it is one of Cassandra’s greatest strengths.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*Q_q5UU6IJXRNtIhYArrohg.png" /></figure><p><strong>Tunable Consistency: Cassandra’s Secret Weapon</strong></p><p>At first glance, Cassandra appears to be a classic AP database because it prioritises availability during network partitions.</p><p>However, Cassandra introduces a unique capability that distinguishes it from many distributed databases: <strong>Tunable Consistency.</strong></p><p>Instead of enforcing a single consistency model for every operation, Cassandra allows the application to choose the required consistency level independently for each read and write request.</p><p>This means architects can balance consistency, availability, and latency according to the business requirements of each use case.</p><p>For example, a banking application may require stronger consistency when updating account balances, while a recommendation engine may prioritise low latency and high availability.</p><p>This flexibility is one of Cassandra’s most compelling architectural advantages.</p><p><strong>Common Consistency Levels</strong></p><h3><strong>1) ONE</strong></h3><p>The coordinator waits for a successful response from <strong>one replica</strong> before acknowledging the operation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*K4drqBrna5BdnlyeNJcF9w.png" /></figure><p><strong>Advantages</strong></p><ul><li>Lowest latency</li><li>Highest availability</li><li>Excellent throughput</li></ul><p><strong>Disadvantages</strong></p><ul><li>Reads may temporarily return stale data</li><li>Weaker consistency guarantees</li></ul><p><strong>Typical Use Cases</strong></p><ul><li>User activity logs</li><li>Metrics collection</li><li>IoT telemetry</li><li>Clickstream analytics</li></ul><h3><strong>2) QUORUM</strong></h3><p>A majority of replicas must acknowledge the operation.</p><p>For a replication factor of three, at least <strong>two replicas</strong> must respond successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*4xWeHajZMGlcmDkyf51E6g.png" /></figure><p><strong>Advantages</strong></p><ul><li>Strong balance between consistency and availability</li><li>Prevents most stale reads</li><li>Common production choice</li></ul><p><strong>Disadvantages</strong></p><ul><li>Slightly higher latency</li><li>More network communication</li></ul><p><strong>Typical Use Cases</strong></p><ul><li>Customer profiles</li><li>Product catalogues</li><li>Order management</li><li>Inventory</li></ul><h3><strong>3) LOCAL_QUORUM</strong></h3><p>Only replicas within the <strong>local data centre</strong> participate in the quorum calculation.</p><p>This avoids waiting for acknowledgements from remote regions, significantly reducing latency for globally distributed deployments.</p><p><strong>Advantages</strong></p><ul><li>Low cross-region latency</li><li>High availability</li><li>Excellent for multi-data-centre clusters</li></ul><p><strong>Disadvantages</strong></p><ul><li>Lower consistency</li><li>Data conflicts</li><li>Not ideal for large distributed transactions</li></ul><p><strong>Typical Use Cases</strong></p><ul><li>Global SaaS applications</li><li>Multi-region e-commerce platforms</li><li>International banking systems</li></ul><h3><strong>4) ALL</strong></h3><p>Every replica must acknowledge the request before it is considered successful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/1*i9U0NRjMghDJuca3M14Rgg.png" /></figure><p><strong>Advantages</strong></p><ul><li>Maximum consistency</li><li>Every replica is immediately synchronised</li></ul><p><strong>Disadvantages</strong></p><ul><li>Highest latency</li><li>Least fault tolerant</li><li>Any unavailable replica causes the operation to fail</li></ul><p><strong>Typical Use Cases</strong></p><ul><li>Critical financial records</li><li>Regulatory compliance</li><li>Sensitive configuration data</li></ul><h3><strong>5) EACH_QUORUM</strong></h3><p>In multi-data-centre deployments, a quorum of replicas must acknowledge the operation <strong>within every participating data centre</strong>.</p><p>Unlike QUORUM, which considers the cluster, EACH_QUORUM ensures that each region independently reaches a majority before the operation succeeds.</p><p><strong>Advantages</strong></p><ul><li>Strong consistency across multiple regions</li><li>Suitable for globally distributed critical applications</li></ul><p><strong>Disadvantages</strong></p><ul><li>Highest inter-region latency</li><li>Reduced availability during regional outages</li><li>Increased network overhead</li></ul><p><strong>Typical Use Cases</strong></p><ul><li>Global financial platforms</li><li>Cross-region transaction processing</li><li>Mission-critical enterprise systems</li></ul><p><strong>How Cassandra Stores Data</strong></p><p><em>Bigger Nodes or More Nodes? The Cassandra Question That Divides Architects</em></p><p>Apache Cassandra is best understood as a distributed system that answers one fundamental question very efficiently: <strong>given a piece of data, which nodes should store it, and where should we look for it?</strong></p><p>Unlike a traditional relational database, Cassandra does not primarily organize data around joins and relationships. Its data model is <strong>query-driven</strong>: the way an application needs to retrieve data determines how the data should be partitioned and organized.</p><p><strong>1. From Row to Partition</strong></p><p>Consider a simple table:</p><p>CREATE TABLE buildings (</p><p>building_id uuid,</p><p>floor int,</p><p>room int,</p><p>name text,</p><p>PRIMARY KEY (building_id, floor, room)</p><p>);</p><p>The Cassandra primary key has two logical parts:</p><ul><li><strong>Partition key:</strong> building_id</li><li><strong>Clustering columns:</strong> floor, room</li></ul><p>The term <strong>row key</strong> is sometimes used informally, but Cassandra’s precise terminology is <em>primary key</em>. Similarly, “cluster key” is more accurately called a <strong>clustering column</strong>.</p><p>The partition key determines <strong>where the data lives</strong> in the cluster. The clustering columns determine <strong>how rows are ordered within that partition</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*pXNiH0JJUWW4Ni94LVGazQ.png" /></figure><p>All rows with the same partition key belong to the <strong>same partition</strong>. A partition is therefore a logical grouping of related rows, and Cassandra stores that partition on the same set of replica nodes.</p><p>This is one of Cassandra’s most important design principles: <strong>the partition key determines locality; clustering columns determine order.</strong></p><p><strong>2. The Partitioner: Turning a Key into a Location</strong></p><p>Cassandra must translate a partition key such as:</p><p>building_id = “Building-A”</p><p>into a numeric <strong>token</strong>. The partitioner performs this mapping.</p><p>Conceptually:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*LW0p7Pi-tX2lS4M5tIH78g.png" /></figure><p>The token space is divided into <strong>token ranges</strong>, and nodes are responsible for portions of that space. The partitioner’s job is therefore fundamental to distributing data across the cluster.</p><p><strong>Cassandra partitioners</strong></p><p>Historically, Cassandra has provided several partitioners:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*qXxSviAWtvgowPMX6RFznw.png" /></figure><p>The current Cassandra documentation identifies <strong>Murmur3Partitioner as the default</strong>, while older partitioners are primarily retained for backward compatibility. New clusters should normally use the default rather than changing the partitioner.</p><p><strong>Why Murmur3 is generally the best choice</strong></p><p>Murmur3 is not “best” in every theoretical situation, but it is the <strong>standard choice for modern Cassandra deployments</strong> because it provides fast hashing and good distribution of partition keys across the token space. Cassandra’s token-allocation mechanisms are also specifically optimized for Murmur3.</p><p>For a Murmur3 cluster, the token space is approximately:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*XSnd3G818Eg7OhQI9_dgmA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*l8FZcx0cGvyqN8NsLaDlyg.png" /></figure><p>In a real cluster, <strong>vnodes</strong> give each physical node multiple token positions. This makes data distribution and cluster expansion considerably more flexible than assigning one large range to each node.</p><p><strong>3. Replication: One Partition, Multiple Nodes</strong></p><p>Partitioning answers <strong>where the primary copy belongs</strong>. Replication answers <strong>how many copies should exist and where</strong>.</p><p>For example, with:</p><p>Replication Factor (RF) = 3</p><p>a partition may be stored on three different physical nodes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/415/1*cgB-3fE61nay-KlIf1S0FQ.png" /></figure><p>Replication provides <strong>availability and durability</strong>. If one node becomes unavailable, another replica can respond to the request. Cassandra’s replication strategy can also place replicas across racks and datacentres to reduce the impact of infrastructure failures.</p><p>For production systems, Cassandra recommends <strong>NetworkTopologyStrategy</strong>, which allows replication factors to be specified per datacentre and considers rack placement.</p><p><strong>Advantages</strong></p><p><strong>1. Horizontal scalability</strong><br> Data is distributed across many nodes, allowing capacity and throughput to grow by adding machines.</p><p><strong>2. High availability</strong><br> Replication means that a node failure does not necessarily make data unavailable.</p><p><strong>3. Fast, predictable reads</strong><br> When the partition key is known, Cassandra can identify the relevant token range and replica set without scanning the entire cluster.</p><p><strong>4. Efficient range queries within a partition</strong><br> Clustering columns keep rows ordered inside a partition, making queries such as “all rooms on Floor 2” efficient.</p><p><strong>5. Flexible geographical distribution</strong><br> Replication can be configured across datacentres, making Cassandra suitable for globally distributed systems.</p><p><strong>Disadvantages</strong></p><p><strong>1. Poor partition-key design can create hotspots</strong><br> If enormous numbers of rows share one partition key, that partition can become a read/write bottleneck.</p><p><strong>2. Large partitions are expensive</strong><br> Partitions should be designed to remain reasonably bounded; neither extremely large nor excessively fragmented partitions are desirable.</p><p><strong>3. Limited ad-hoc querying</strong><br> Cassandra is designed around known access patterns rather than arbitrary relational queries and joins.</p><p><strong>4. Data duplication is common</strong><br> To support different query patterns, applications may maintain multiple denormalized tables.</p><p><strong>5. Partitioning is difficult to change later</strong><br> Changing the partitioner requires reloading the data, so the initial architectural decision matters.</p><p><strong>The Real Question: How Should Nodes Be Sized?</strong></p><p>Surprisingly, Cassandra documentation spends far more time discussing replication, consistency, partitioning, and data modelling than it does answering one of the most consequential questions in a production deployment: <strong>how should the nodes themselves be sized?</strong> Yet this decision often determines whether a Cassandra cluster remains healthy as it grows or gradually becomes difficult to operate. Choosing the right replication factor or understanding the token ring is important, but those decisions ultimately run on physical infrastructure — CPU, memory, disk capacity, disk throughput, network bandwidth, and, critically, the amount of work each node is expected to absorb.</p><p>This is where the difference between <strong>knowing Cassandra and operating Cassandra</strong> becomes apparent. The theoretical model is relatively straightforward: partition the data, distribute partitions across the token space, replicate them across nodes, and use consistency levels to control how many replicas participate in a read or write. On paper, the cluster looks beautifully balanced. In production, however, the question is no longer simply <em>“Where does this partition live?”</em> It becomes <em>“What happens when this node is responsible for hundreds of thousands of partitions, sustained writes, compaction, repair traffic, hinted handoff, streaming, and a large volume of concurrent reads — all at the same time?”</em></p><p>A Cassandra node is not just a container for data. It is simultaneously a <strong>storage engine, query executor, replica, compaction worker, repair participant, and network endpoint</strong>. Its resources are shared across all of these responsibilities. A node that appears comfortably sized when measured only against the current dataset can become severely constrained when background operations and future growth are factored in. This is why sizing Cassandra purely from today’s data volume is one of the easiest mistakes to make.</p><p>The bookish approach often starts with a deceptively simple calculation: <em>we have X terabytes of data; therefore, we need Y nodes</em>. Real deployments are rarely that linear. The more useful question is not simply how much data a node can store, but <strong>how much work a node can perform while still maintaining acceptable latency and operational headroom</strong>.</p><p>Two clusters with exactly the same amount of data can have completely different infrastructure requirements because their workloads differ. A write-heavy time-series workload, a read-heavy application with unpredictable access patterns, and a workload dominated by large partitions can place radically different demands on the same hardware.</p><p>There is also a subtle relationship between <strong>partitioning, replication, and node sizing</strong>. The partition key determines how data is distributed; the partitioner maps that key into the token space; replication determines how many nodes carry each partition. But the resulting distribution is only useful if the nodes have sufficient capacity to handle their assigned workload. A theoretically even token distribution does not necessarily mean an operationally even cluster. Equal amounts of data across nodes can still result in unequal CPU utilization, disk I/O, cache effectiveness, or query latency.</p><p>Experience also changes how one thinks about “capacity.” A node should not be sized to run at its maximum theoretical utilization under normal conditions. Cassandra needs room to perform the work that is not visible in a simple storage calculation — <strong>compaction, repair, bootstrap and streaming, node replacement, workload spikes, and failure scenarios</strong>. A cluster that performs perfectly when every node is healthy may behave very differently when one node disappears and its workload is temporarily redistributed. Production sizing therefore has to account not only for normal operation, but also for the cluster’s behaviour when things go wrong.</p><p>This is perhaps the most important lesson that is difficult to appreciate from documentation alone: <strong>cluster sizing is not a one-time capacity calculation; it is a resilience decision.</strong> The objective is not to build the smallest cluster that can handle today’s workload. It is to build a cluster that can handle tomorrow’s workload, background maintenance, expected growth, and foreseeable failures without crossing the thresholds where latency and operational stability begin to deteriorate.</p><p>That is why node sizing deserves to sit at the heart of any discussion about Cassandra architecture. Partition keys, token ranges, replication factors, consistency levels, and partitioners explain <strong>how Cassandra distributes and protects data</strong>. Node sizing determines whether the infrastructure underneath that design can actually sustain it. The difference between a Cassandra cluster that works in a diagram and one that works reliably in production lies largely in understanding that distinction — and learning, through deployment and operation, where the theoretical model meets the physical limits of the system.</p><p>Now let’s compare</p><p><strong>Option 1 → Large Uniform Nodes</strong></p><p>20 Nodes — 128 GB RAM — 32 CPU — 10 TB SSD</p><p><strong>Advantages</strong></p><ul><li>Easier operations</li><li>Fewer servers</li><li>Lower network chatter</li><li>Lower repair overhead</li><li>Simpler monitoring</li></ul><p><strong>Disadvantages</strong></p><ul><li>Longer rebuilds</li><li>Larger blast radius</li><li>More expensive failures</li><li>Harder maintenance</li></ul><p><strong>Option 2 → Many Small Nodes</strong></p><p>80 Nodes — 32 GB RAM — 8 CPU — 2 TB SSD</p><p><strong>Advantages</strong></p><ul><li>Faster recovery</li><li>Smaller failures</li><li>Better elasticity</li><li>Better parallelism</li></ul><p><strong>Disadvantages</strong></p><ul><li>More gossip</li><li>More repairs</li><li>More JVMs</li><li>Higher operational complexity</li></ul><p><strong>Unlike Sized Nodes</strong></p><p>This is where our discussion becomes unique. Consider a simple two node ring. The nodes are as described below: -</p><p>Node A — 64 cores -512 GB RAM</p><p>Node B — 16 cores — 64 GB RAM</p><p>Should Cassandra have different sized nodes? Is this configuration possible? Will such a config be required? Is this prescribed as a part of any solution?</p><p><strong>Why Node Sizing Becomes Difficult</strong></p><p>The difficulty begins with an important distinction: <strong>Murmur3 distributes tokens, not hardware capacity</strong>.</p><p>Cassandra’s partitioner maps partition keys into a token space and uses that token space to distribute data across the cluster. The underlying assumption is that the nodes participating in that distribution have broadly comparable capacity. In other words, Cassandra can distribute ownership of the token ring very effectively, but equal token ownership does not automatically mean equal utilisation of the underlying hardware.</p><p>Consider two nodes with very different capabilities:</p><ul><li><strong>Node A:</strong> 32 CPU cores, 256 GB RAM, high-performance SSD storage</li><li><strong>Node B:</strong> 8 CPU cores, 64 GB RAM, lower-performance SSD storage</li></ul><p>If both nodes are assigned approximately the same token ownership, Cassandra’s data distribution may appear balanced from a <strong>token perspective</strong>. From a <strong>hardware perspective</strong>, however, the cluster is not balanced at all. The smaller node may be expected to process a workload that is comparable to the much larger node.</p><p><strong>What happens when capacity and ownership don’t align?</strong></p><p>This mismatch can manifest in several ways:</p><ul><li><strong>Uneven CPU utilisation</strong> — less capable nodes can reach CPU saturation earlier.</li><li><strong>Longer compactions</strong> — slower storage or constrained CPU can cause compaction work to accumulate.</li><li><strong>Slower repairs</strong> — repair and streaming operations can take considerably longer on weaker nodes.</li><li><strong>Hot nodes</strong> — a node may become a bottleneck even though token ownership appears evenly distributed.</li><li><strong>Streaming bottlenecks</strong> — bootstrap, node replacement, or scaling operations can be constrained by the weakest participating node.</li><li><strong>Increased read latency</strong> — overloaded nodes can affect tail latency even when the overall cluster appears healthy.</li></ul><p>This is an important practical distinction: <strong>a balanced ring does not necessarily mean a balanced cluster</strong>.</p><p><strong>Are unlike-sized nodes always a bad idea?</strong></p><p>Not necessarily.</p><p>Heterogeneous clusters can be perfectly valid in certain real-world situations. They often arise naturally rather than through deliberate architectural design. Common examples include:</p><ol><li><strong>Hardware refreshes during migration</strong><br> Newer hardware may be introduced gradually while older nodes remain in service.</li><li><strong>Cloud instance transitions</strong><br> Organisations may move between cloud instance families or generations without rebuilding the entire cluster at once.</li><li><strong>Mixed storage generations</strong><br> A cluster may temporarily contain nodes using different generations of SSD or storage technology.</li><li><strong>Incremental expansion</strong><br> Additional capacity may be added using newer and more powerful machines than those originally deployed.</li><li><strong>Cost optimisation</strong><br> Different workloads or environments may justify different hardware profiles.</li><li><strong>Non-linear business growth<br> </strong>There are always surprises where new business springs up and it so happens with little to no prior intimation. Given the competitiveness in the marketplace, existing capacity is applied to meet the business challenge head-on.</li></ol><p>Modern Cassandra versions also provide token-allocation mechanisms that can take node capacity into account, allowing more capable nodes to own proportionally larger portions of the token ring. This is a significant improvement over assuming that every node should receive identical ownership.</p><p>However, <strong>weighted token ownership does not eliminate the complexity of heterogeneous hardware</strong>. It changes the distribution problem from <em>“Does every node own the same amount?”</em> to the more useful question of <em>“Does each node own an amount appropriate to its actual capacity?”</em></p><p>That distinction matters operationally. CPU, memory, disk throughput, network bandwidth, compaction performance, and workload characteristics do not scale perfectly with token ownership. A node that is twice as powerful is not necessarily capable of handling exactly twice the workload across every dimension.</p><p><strong>The practical lesson</strong></p><p>The theoretical model says: <strong>distribute tokens evenly and the data will be distributed evenly.</strong></p><p>The production lesson is more nuanced:</p><p><strong>Distribute workload in proportion to capacity, not simply tokens in proportion to nodes.</strong></p><p>Heterogeneous Cassandra clusters can therefore be a deliberate and useful architectural choice, particularly during migrations, cloud transitions, and incremental growth. But they should be designed and monitored consciously. If unlike-sized nodes appear simply because the infrastructure evolved over time, the cluster may be technically valid while still being operationally unbalanced.</p><p>Ultimately, <strong>token ownership is only a proxy for workload</strong>. The real objective is to ensure that the work generated by that ownership can be handled comfortably by the hardware underneath it. A rudimentary diagram that describes this in a 4-node cluster is below: -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*4r9QzWHg0T88wg6DCiLCaA.png" /></figure><p><strong>Final Thoughts</strong></p><p>Cassandra’s brilliance lies not just in its peer-to-peer architecture or tunable consistency — it lies in how predictably it distributes data across a cluster. Yet that predictability is only as effective as the hardware beneath it. A well-sized cluster turns Murmur3’s even token distribution into balanced throughput, low latency, and operational resilience. Conversely, poor sizing can negate many of Cassandra’s architectural advantages. As cloud platforms make heterogeneous infrastructure increasingly common, architects must look beyond the simple question of <em>how many nodes</em> and instead ask the more meaningful one: <em>what should each node contribute to the ring? </em>A guide that is fuelled from knowledge gained from experience and latent deployments that had to be fixed to achieve sustainable and reliable performance in production ensuring client’s competitive advantage is as below: -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GUhm_SYHc7wqlgRkHcw0uQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2597364a3bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond Polling: Engineering Real-Time Applications with CDC and Redis Data Integration]]></title>
            <link>https://medium.com/@vinay.paix/beyond-polling-engineering-real-time-applications-with-cdc-and-redis-data-integration-c116d197cae1?source=rss-66189379b642------2</link>
            <guid isPermaLink="false">https://medium.com/p/c116d197cae1</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[rdi]]></category>
            <category><![CDATA[architecture]]></category>
            <dc:creator><![CDATA[VP]]></dc:creator>
            <pubDate>Wed, 22 Jul 2026 03:57:25 GMT</pubDate>
            <atom:updated>2026-07-22T04:03:32.026Z</atom:updated>
            <content:encoded><![CDATA[<p><em>The Moment Data Changes… Everything Changes. Consume data at the Speed of Business</em></p><p>Modern enterprises no longer compete on the amount of data they own — they compete on <strong>how quickly they can react to changes in that data</strong>. Every customer registration, payment, order update, inventory change, or security event is an opportunity to make a business decision and a tangible difference. Unfortunately, most applications are still built around scheduled synchronization jobs, periodic ETL pipelines, or expensive point-to-point integrations that introduce latency, operational complexity, and stale data.</p><p>This is where <strong>Change Data Capture (CDC)</strong> and a top of the line tool like <strong>Redis Data Integration (RDI)</strong> fundamentally change the architecture and the response to like stimuli. Instead of asking <em>“What has changed since the last sync?”</em>, modern applications are notified the instant a change occurs and ask the question “<em>What must I do with the change?”.</em></p><p><strong>A. The Problem with Traditional Data Synchronization or Polling</strong></p><p>Data is the new oil. Every process, action, event performed by a person or a system invariably leaves a ubiquitous data exhaust. It’s quintessential now that every enterprise application depends on moving data between systems.</p><p>Think about a typical enterprise ecosystem:</p><ul><li>Customer data in CRM</li><li>Orders in transactional databases</li><li>Inventory in ERP</li><li>Identity information in an identity store like LDAP</li><li>Analytics in Data Warehouse</li><li>Caching layer for application performance</li></ul><p><strong>The challenge?</strong></p><p>Every one of the above systems continuously changes. Not tracking or a delay in knowing of the change could mean a wide spectrum from a missed opportunity to an absolute preventive action like catching fraud or a simple miss of a data point to a loss of business. This is because traditional synchronization methods include:</p><ul><li>Batch ETL jobs</li><li>Database polling</li><li>Scheduled synchronization</li><li>API-based synchronization</li><li>Manual refreshes</li></ul><p>These approaches though are automated, monitored and specifically designed to be functionally efficient, create several problems.</p><p><strong>1.</strong> <strong>Increased Latency</strong></p><p>Applications may wait minutes — or even hours — before another system becomes aware of a change. This would impact</p><p>Example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*HhK3H2-uKCHgXT5N3pOQaA.png" /></figure><p><strong>2.</strong> <strong>Higher Infrastructure Cost</strong></p><p>Polling databases or stores every few seconds generates unnecessary load. It’s repetitive, redundant and computationally costly when otherwise the same effort can be redirected to run business logic.</p><p>Imagine:</p><p>100 applications polling × every 5 seconds × millions of records = Massive wasted database capacity.</p><p><strong>3.</strong> <strong>Data Inconsistency</strong></p><p>Different systems begin showing different versions of the same data.</p><p>The result is:</p><ul><li>stale caches</li><li>outdated reports</li><li>delayed notifications</li><li>poor customer experience</li></ul><p><strong>B. Understanding Change Data Capture (CDC)</strong></p><p><strong>What is CDC?</strong></p><p>Change Data Capture is a technique that continuously captures changes occurring inside a database and streams only those changes to downstream systems.</p><p>Instead of copying the entire dataset repeatedly, CDC captures events such as:</p><ul><li>INSERT</li><li>UPDATE</li><li>DELETE</li></ul><p>and immediately propagates those changes.</p><p>Think of CDC as a <strong>live event feed for your database</strong>. Instead of asking: “Has anything changed?”, the database simply says: “Here’s exactly what changed. What must I do with it?”</p><p><strong>Why CDC Matters ?</strong></p><p>CDC transforms data synchronization from <strong>periodic replication</strong> into <strong>continuous event streaming</strong>.</p><p>Key benefits include:</p><p>· <strong>Near Real-Time Data Availability</strong></p><p>Applications react within milliseconds instead of waiting for scheduled synchronization.</p><p>· <strong>Reduced Database Load</strong></p><p>o Only changed records are transmitted.</p><p>o No expensive full-table scans.</p><p>· <strong>Better Scalability</strong></p><p>Thousands of applications can subscribe to the same stream instead of querying databases independently.</p><p>· <strong>Improved User Experience</strong></p><p>Applications always operate on fresh data.</p><p>Examples:</p><ul><li>Live order tracking</li><li>Instant inventory updates</li><li>Fraud detection</li><li>Password synchronization</li><li>Personalized recommendations</li><li>Entitlements management</li><li>Logic driving metadata change</li></ul><p>· <strong>Event-Driven Architecture</strong></p><p>CDC naturally fits into modern microservice architectures where services communicate through events rather than tightly coupled APIs.</p><p><strong>Traditional Synchronization vs CDC</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*Us6CAY8in-w0nI5hYcm4qg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*BH-N_7S5lVsFYp6bKeM_fw.png" /></figure><p><strong>Introducing Redis Data Integration (RDI)</strong></p><p>Once CDC events are available, they need to be processed, transformed, enriched, and delivered to downstream consumers efficiently. This is precisely where <strong>Redis Data Integration (RDI)</strong> adds value.</p><p>RDI is Redis Enterprise’s real-time data integration framework that ingests database changes from CDC sources, applies transformation logic, and updates Redis automatically.</p><p>Rather than building custom synchronization services, organizations can leverage RDI to create low-latency, event-driven data pipelines with significantly less operational overhead.</p><p>In simple terms:</p><p><strong>CDC captures the change. RDI makes the change almost immediately useful.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*aT_0pRrBrdm62blauxpBxg.png" /></figure><p><strong>Where RDI Shines: Common Use Cases</strong></p><p>Redis Data Integration is especially valuable wherever systems need to react immediately to changes in operational data. Typical scenarios include:</p><p><strong>What Makes RDI Powerful?</strong></p><p><strong><em>From Database Changes to Real-Time Intelligence: Why Redis Data Integration (RDI) is a Game Changer</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/316/1*lRrwK2wXhi0W1Z3-yidQLA.png" /></figure><p>· <strong>Native CDC Integration</strong></p><p>Works seamlessly with CDC pipelines without custom polling logic.</p><p>· <strong>Real-Time Data Movement</strong></p><p>Data reaches Redis within milliseconds.</p><p>· <strong>Flexible Transformations</strong></p><p>Business rules can be applied before data lands in Redis.</p><p>Examples include:</p><ul><li>field mapping</li><li>schema conversion</li><li>JSON restructuring</li><li>key generation</li><li>data enrichment</li></ul><p>· <strong>Simplified Architecture</strong></p><p>It removes the need for:</p><ul><li>custom synchronization services</li><li>scheduled ETL jobs</li><li>cache refresh scripts</li></ul><p>· <strong>High Throughput</strong></p><p>Processes thousands of changes per second while maintaining very low latency.</p><p>· <strong>Operational Simplicity</strong></p><ul><li>Minimal code.</li><li>Less infrastructure.</li><li>Fewer moving parts.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ct9pv-IEzyy_7vI_ZOVgCA.png" /></figure><p><strong>D. Where RDI Shines: Common Use Cases</strong></p><p>Redis Data Integration is especially valuable wherever systems need to react immediately to changes in operational data. Typical scenarios include:</p><p>· <strong>High-Performance Application Caching</strong></p><p>Keep Redis synchronized with transactional databases in near real time so applications always read fresh data without repeatedly querying the primary database.</p><p>· <strong>Identity and Access Management</strong></p><p>Synchronize user profiles, credentials, roles, and permissions from identity stores into Redis to support low-latency authentication and authorization.</p><p>· <strong>Microservices Data Distribution</strong></p><p>Allow multiple services to consume consistent, up-to-date reference data without creating tightly coupled dependencies on the source database.</p><p>· <strong>Real-Time Analytics</strong></p><p>Feed dashboards and operational metrics as changes occur, enabling live monitoring instead of waiting for periodic ETL jobs.</p><p>· <strong>Inventory and Order Management</strong></p><p>Reflect stock changes, order status, and fulfilment updates instantly across e-commerce and retail platforms.</p><p>· <strong>Fraud Detection and Risk Scoring</strong></p><p>Stream financial or transactional events into Redis for immediate evaluation by rules engines or machine learning models.</p><p>· <strong>Customer Personalization</strong></p><p>Refresh customer preferences, loyalty information, and behavioural attributes in Redis so recommendations remain current.</p><p>· <strong>Legacy System Modernization</strong></p><p>Replace scheduled synchronization jobs and brittle replication scripts with event-driven integration, reducing maintenance effort and improving reliability.</p><p><strong>RDI Challenges</strong></p><p>No system is perfect and the same hold true for RDI as well. RDI acts as a quintessential bridge between data updates and that same data being needed to read. It partners up with any existing systems already in play and can fit right in with minimal changes.</p><p>· <strong>Eventual Consistency</strong> — Users or services may read old data because background replication has not finished yet. This is particularly pronounced when the write to the application data store takes a short while.</p><p>· <strong>Conflict Resolution:</strong> Concurrent updates to the same data on different nodes create diverging values that require merging strategies like last-write-win.</p><p>· <strong>Out-of-Order Events:</strong> Network delays can cause updates or events to arrive out of sequence, breaking business logic if not buffered or timestamped. Though the setup is automatic, it is network dependent and this must be planned for a failsafe in the architecture.</p><p>· <strong>Missing Safety Guarantees:</strong> The system promises it will converge eventually but offers no rule on <em>when</em> or what intermediate state a read might catch. This must be a consideration in terms of system and process design.</p><p>· <strong>Increased App Complexity:</strong> Developers must write extra code for idempotency and special handling so duplicate or delayed messages do not break the app.</p><p>· <strong>Needs external setup:</strong> Though the convenience is underscored, its worth noting that this system must be setup and a pipeline needs to be established with the necessary transformation rules etc.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c116d197cae1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>