<?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 Sarthak Joshi on Medium]]></title>
        <description><![CDATA[Stories by Sarthak Joshi on Medium]]></description>
        <link>https://medium.com/@joshisarthak2002?source=rss-e38985a65773------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Sarthak Joshi on Medium</title>
            <link>https://medium.com/@joshisarthak2002?source=rss-e38985a65773------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 11:15:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@joshisarthak2002/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[dMigrating from Cassandra to DynamoDB]]></title>
            <link>https://medium.com/@joshisarthak2002/migrating-from-cassandra-to-dynamodb-86487fc016df?source=rss-e38985a65773------2</link>
            <guid isPermaLink="false">https://medium.com/p/86487fc016df</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[db-migration]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[migration]]></category>
            <dc:creator><![CDATA[Sarthak Joshi]]></dc:creator>
            <pubDate>Sun, 01 Nov 2026 10:09:42 GMT</pubDate>
            <atom:updated>2026-11-23T04:16:29.088Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4USYkc3QxWIfEvwxxurPXQ.jpeg" /></figure><p>This article covers the end-to-end, production-grade migration from Apache Cassandra to Amazon DynamoDB across more than 30 microservices — from the initial proof of concept (POC) to production rollouts. It outlines the migration approach, implementation strategy, and measures taken to preserve API response times throughout the transition. It also explains how existing legacy data was migrated and how production traffic was gradually ramped up to support a controlled rollout.</p><h3>Approach :</h3><p>Run Cassandra and DynamoDB in parallel, with service-level changes enabling flag-controlled dual writes and reads from a single database at a time. Migrate existing legacy data from Cassandra to DynamoDB, then gradually shift read and write traffic to DynamoDB through a controlled, phased rollout.</p><h3>Detailed Database Migration Plan :</h3><p>1. Set Up Feature Flags for Parallel Database Operations</p><p>Introduce feature flags to control which operations each database supports. Supported operations are STORE, READ, and DELETE.<br>properties<br>cassandra.enabled.operation_names=<br>dynamodb.enabled.operation_names=</p><p>2. Enable Dual Writes While Reading from Cassandra</p><p>Initially, enable writes and deletes in both databases while serving reads exclusively from Cassandra.</p><blockquote>properties<br>cassandra.enabled.operation_names=STORE,READ,DELETE<br>dynamodb.enabled.operation_names=STORE,DELETE</blockquote><p>Writing synchronously to both databases can increase API response times. To minimize this impact, keep primary database writes synchronous and perform <strong>secondary database writes asynchronously.</strong> Initially, DynamoDB is the secondary database.</p><blockquote>properties<br>currentAsyncDbEnabled=DYNAMODB</blockquote><blockquote>The supported values are CASSANDRA and DYNAMODB, depending on the migration phase. Monitor asynchronous write failures and replication lag to ensure reliable data delivery.</blockquote><p>3. Backfill Legacy Data</p><p>Once writes to DynamoDB are working reliably, migrate existing Cassandra data using <strong>production Spark jobs.</strong></p><p>For tables with TTLs shorter than 30 days, backfilling can be avoided by running dual writes for the full TTL period. Existing records expire naturally, while new records populate both databases. This requires equivalent expiration behavior and successful replication of all writes.</p><p>4. Continue Reading from Cassandra</p><p>Keep Cassandra as the primary read database throughout backfilling and validation. This preserves the existing read path while DynamoDB is prepared for production traffic.</p><p>5. Validate Data Consistency and Monitor Metrics</p><p>Run validation jobs to compare records across both databases and verify that legacy data has migrated correctly. Monitor API response times, application errors, asynchronous write failures, and replication lag before switching reads.</p><p>6. Switch Reads to DynamoDB</p><p>Enable reads in DynamoDB and explicitly select it as the primary read database. enabled write to cassandra async</p><blockquote>properties<br>cassandra.enabled.operation_names=STORE,DELETE<br>dynamodb.enabled.operation_names=STORE,READ,DELETE<br>currentAsyncDbEnabled=CASSANDRA</blockquote><p>DynamoDB now handles primary reads and synchronous writes, while Cassandra receives asynchronous writes. Apply this configuration in controlled stages to gradually ramp up production traffic.</p><p>7. Monitor for Errors and Maintain a Fallback</p><p>Closely monitor API latency, error rates, and data consistency after switching reads. If issues arise, revert reads to Cassandra and restore DynamoDB as the asynchronous secondary database. Confirm that Cassandra is up to date before rolling back.</p><p>8. Gradually Disable Writes to Cassandra</p><p>Once DynamoDB is stable and validation is complete, progressively disable writes and deletes to Cassandra. Maintain dual writes throughout the agreed rollback window before transitioning to DynamoDB-only operations.</p><p>9. Retire Cassandra Data and Resources</p><p>After the rollback window closes, safely remove unused Cassandra data in accordance with retention and compliance requirements. Decommission Cassandra resources once no remaining services depend on them.</p><p>10. Remove Migration Feature Flags and Clean Up the Code</p><p>After the migration is complete, remove migration-specific feature flags, dual-write logic, and unused Cassandra integration code. This simplifies configuration and leaves the services operating solely on DynamoDB.</p><h3>Production Ramp-Up Strategy</h3><p>Production traffic was gradually ramped up using percentage-based routing through Akamai. A cookie was set for the selected traffic, and its value determined the migration feature flag configuration, controlling which database handled reads and which received asynchronous writes. This enabled a controlled rollout to DynamoDB, allowing us to validate data consistency, monitor API performance, and check for data loss at each stage before increasing traffic further.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86487fc016df" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>