<?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 Luram Archanjo on Medium]]></title>
        <description><![CDATA[Stories by Luram Archanjo on Medium]]></description>
        <link>https://medium.com/@luram.archanjo?source=rss-58b171af1418------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*TAf35oY724A_oXiWfU6szA.jpeg</url>
            <title>Stories by Luram Archanjo on Medium</title>
            <link>https://medium.com/@luram.archanjo?source=rss-58b171af1418------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 25 Nov 2026 02:15:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@luram.archanjo/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[Mutation testing at Mercado Libre: From pilot to everyday guardrail]]></title>
            <link>https://medium.com/mercadolibre-tech/mutation-testing-at-mercado-libre-from-pilot-to-everyday-guardrail-2ffe0a273f0e?source=rss-58b171af1418------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ffe0a273f0e</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[code-quality]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[software-quality-testing]]></category>
            <dc:creator><![CDATA[Luram Archanjo]]></dc:creator>
            <pubDate>Wed, 14 Jan 2026 12:19:01 GMT</pubDate>
            <atom:updated>2026-01-14T14:05:18.161Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xBaHIv7186gNrrYTtpio-A.png" /></figure><p>Beyond coverage: How we integrated mutation testing into Fury pipelines and turned it into an actionable quality indicator for teams</p><p>At Mercado Envíos (ME), we saw that high test coverage didn’t always prevent regressions — pull requests (PRs) were green, but we still broke production. In this article, we share how we brought <strong>mutation testing</strong> into our pipelines on Fury, our internal developer platform (IDP). We used a single multi-stack GitHub Action, a delta-first approach, and gradual team-level gates. We walk through the design decisions, challenges, and lessons learned that helped us turn this technique into an everyday guardrail that improves test effectiveness and PR quality.</p><h3>Introduction: Green PR, still an incident</h3><p>Friday, end of the day. You’ve got a green PR, pipelines are passing, and coverage looks great. You merge with confidence. On Monday, production goes down because of an edge case no one asserted.</p><p>Sounds familiar? Same here.</p><p>Coverage tells us what runs, not whether tests fail where they should. You can have 95–100% line coverage and still let a subtle regression slip — a slightly wrong if condition, an unexpected default value, a branch with no assertions.</p><p>That’s where mutation testing comes in. Instead of assuming tests are good just because they pass, you intentionally introduce small code changes (mutants) and check whether the test suite kills them. In mutation testing, <strong>“killing a mutant”</strong> means your test suite <strong>fails when run on the mutated code</strong>, proving it can detect the injected defect. If mutants survive, you get a concrete indicator of weak assertions exactly in the area you’re changing.</p><p>At Mercado Envíos (ME), we moved from a one-off experiment to making mutation testing part of teams’ daily flow. We integrated it into our standard pipelines on <a href="https://www.youtube.com/watch?v=jhSoFPONQ5s">Fury</a>, Mercado Libre’s internal developer platform. We did it without breaking delivery: a single, multi-stack GitHub Action; delta-first execution focused on modified code; and team-level gates with thresholds agreed per team. The result: more objective PR discussions and fewer silent regressions.</p><p><strong>The problem: When coverage isn’t enough</strong></p><p>At Mercado Envíos (ME), we faced an uncomfortable pattern: green PRs, high coverage — and regressions anyway. The pipeline said everything was fine, but small changes — a boundary comparison, a default return, a rarely used branch — still slipped into production.</p><p>The root cause wasn’t a lack of tests, but tests that exercised code without really validating the behavior that mattered. Many suites were optimized to execute lines (boost coverage), not to catch subtle logic deviations. In PR reviews, that turned into subjective discussions:</p><ul><li>Does this test really validate the right thing?</li><li>Aren’t we just testing the happy path?</li></ul><p>The context at ME made this even more painful: high change throughput, multiple stacks (Java, Kotlin, TypeScript/JavaScript, Go), parallel teams, and pipelines with only a few minutes to run. We needed an indicator that was local to the change (looking at the PR delta), cheap to operate (without doubling build times), and clear for whoever opens the PR: what broke, where, and why.</p><p>A common example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*6evsGaJRApVZo9cBwdSRuA.png" /></figure><p>Coverage is happy: the line is executed. But the test passes both with “&gt;” and “&gt;=”. If you change the logic in production, your tests stay quiet. That’s exactly the kind of gap we wanted to close.</p><p><strong>Mutation testing in two minutes</strong></p><p>Mutation testing builds on a simple idea:</p><ol><li>Take the source code and generate modified versions called mutants (for example, change “&gt;” to “&gt;=”, “+” to “-”, flip boolean conditions, etc.).</li><li>Run the test suite against each mutant.</li><li>Observe the outcome:</li><li>If a test fails, the mutant is considered killed.</li><li>If all tests still pass, the mutant survives.</li></ol><p>From there, you get metrics like:</p><ul><li><strong>Mutation score: </strong>the percentage of generated mutants that were killed by the tests.</li><li><strong>Test strength:</strong> how effective the suite is at catching reasonable code changes.</li></ul><p>The goal is not to replace coverage, but to <strong>complement it</strong>. Coverage answers, “Which parts of the code are executed?” Mutation testing answers, “If I make a small but realistic change here, does any test complain?” Together, they give a much richer view of your test suite’s health.</p><p>To go a little deeper, one of the frameworks we use — PIT (also known as <a href="https://pitest.org/">PITest</a>) — mutates the compiled bytecode in memory and runs only the tests that exercise the mutated lines. Your .java source files are never touched; each mutant is loaded into a separate Java Virtual Machine (JVM) process that is short-lived and then discarded after the run.</p><h3>Designing the solution as a platform product</h3><p>From day one, we treated this as a platform product within Mercado Envíos (ME). The goal wasn’t just to run a new tool per stack, but to add a reliable indicator to each PR that measures test effectiveness without hurting delivery.</p><p>That led us to four key design decisions: a single GitHub Action, a delta-first approach, useful feedback directly in the PR, and gradual, team-specific gates — all integrated into the standard pipelines we provide through Fury.</p><h4>1) A single multi-stack GitHub Action on top of Fury</h4><p>Instead of asking each team to build its own recipe, we encapsulated the logic in a composite GitHub Action that runs the right mutation engine based on the repository’s tech stack:</p><ul><li>Java/Kotlin/Go → PITest</li><li>TypeScript/JavaScript → Stryker</li></ul><p>The action exposes just a few inputs (mode, scope, thresholds, report formats) and returns simple outputs (score, number of surviving mutants, path to the HTML report). This lets us:</p><ul><li>Standardize the developer experience.</li><li>Simplify maintenance.</li><li>Distribute the capability easily via Fury by embedding it into pipeline templates that teams already use to create services.</li></ul><h4>At the YAML level, the integration looks as simple as:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*9ZRWZeRZeLrMTArd8DODyw.png" /></figure><p>Behind that block, there’s a fair amount of logic, but contributors to the repository see only a reusable action.</p><h4>2) Delta-first: focused indicator with controlled cost</h4><p>Our first attempt was straightforward: mutate the entire module. It worked, but it didn’t scale. It took too long to run on large codebases and consumed excessive computing resources when executed across thousands of repositories, making it impractical. In a PR with only a few minutes of time budget, doubling or tripling pipeline time is a nonstarter.</p><p>Then we found the idea that changed the game: measure only the <strong>delta</strong> of the change.</p><p>In practice, this means:</p><ul><li>Take the files modified in the PR.</li><li>Map them to the smallest reasonable mutation unit (class, package, or file).</li><li>Generate mutants only for that subset.</li></ul><p>The rule we use is simple and repeatable: <strong>Changed file → candidate mutation unit.</strong></p><p>With this deterministic mapping, we drastically cut action time without losing the indicator. We care most about test effectiveness in the code we’re changing now.</p><p>To visualize it, imagine a pipeline diagram where, after the usual tests, a mutation testing step runs only on the diff files. Its result is posted as a PR comment with a traffic-light style indicator.</p><h4>3) Feedback in PRs using dry-run mode</h4><p>Before we blocked anything, we made the invisible visible. The first version ran in <strong>dry-run</strong> mode.</p><p>Each PR received a comment with:</p><ul><li>The overall mutation score for the change</li><li>The number of surviving mutants</li><li>A list of surviving mutants with file and line</li><li>A link to the HTML report for more detail</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*Mf-ZmpPl_EDh4sMTCq-CxQ.png" /></figure><p>Nothing was blocked. The goal wasn’t to pass or fail PRs, but to spark better conversations:</p><ul><li>“On line 142, we’re missing an assertion for the boundary case when the total is exactly 100.”</li><li>“These mutants survive because we’re only testing the happy path.”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*7Ue4z6dZSBWm0fOi-NW8wA.png" /></figure><p>That step was key to aligning expectations:</p><ul><li>Coverage doesn’t go away; we now also have an effectiveness indicator.</li><li>We identify equivalent mutants, generated classes, and inevitable noise.</li><li>We measure the real cost per stack (P95 execution time, report size) and tune from there.</li></ul><h4>4) From dry-run to gate: gradual rollout</h4><p>The obvious temptation was: if mutation testing spots weak assertions, why not block merges from day one?</p><p>Experience told us the opposite: before you add a guardrail that can stop a merge, you need to build trust in the indicator.</p><p>The rollout in Mercado Envíos (ME) was intentionally gradual:</p><p><strong>#1 Indicator first</strong></p><ul><li>We ran the Action in <strong>dry-run</strong> mode.</li><li>We tuned exclusions: logging, config, generated classes, trivial DTOs.</li><li>We tackled flakiness: if a mutant survived once and disappeared on retries, we treated it as an unstable test.</li></ul><p><strong>#2 Then gate, team by team</strong></p><ul><li>Once a team saw a consistent indicator in their repository over several PRs, we discussed thresholds.</li><li>We turned on the gate with an initial mutation score and test strength threshold agreed with the team.</li><li>We defined a responsible bypass for hotfixes and large refactors (a label and a justification in the PR).</li></ul><p>The gate became a dial, not a dogma: we raise it where the indicator is stable and provides real protection for merges.</p><h3>Challenges and lessons learned</h3><p>Adopting mutation testing wasn’t just “install a library and that’s it.” It was as much a technical decision as a product decision. Here are the main challenges we faced and what we learned:</p><p><strong>1) Pipeline time: when “mutate everything” doesn’t scale</strong></p><p><strong>Problem:</strong> mutating the entire module doubled or tripled action duration.</p><p><strong>How we addressed it:</strong></p><ul><li>Use a delta-first approach.</li><li>Apply moderate parallelism.</li><li>Set time and mutant-count budgets.</li></ul><p><strong>Lesson learned:</strong> delta-first is not just a performance optimization; it also focuses the indicator on the current change and reduces historical noise.</p><p><strong>2) Equivalent mutants and inevitable noise</strong></p><p><strong>Problem:</strong> some mutants don’t add real value (e.g., logging), and others are practically equivalent to the original behavior.</p><p><strong>How we addressed it:</strong></p><ul><li>Maintain a shared exclusion list (generated classes, configs, trivial DTOs, infrastructure integrations).</li><li>Define a recommended mutator catalog per stack: start with the defaults, and add condition/return mutators only when they clearly improve the indicator.</li></ul><p><strong>Lesson learned: </strong>some noise will always exist. The key is to document it, share it, and avoid chasing an impossible 100%.</p><p><strong>3) Gate culture and governance</strong></p><p><strong>Problem: </strong>turning on a global gate too soon creates friction — misaligned thresholds, improvised bypasses, and discussions focused on the score instead of the indicator.</p><p><strong>How we addressed it:</strong></p><ul><li>Golden rule: indicator first, gate later.</li><li>Gates per team or module, with explicit agreements.</li><li>Bypass with label and justification for exceptional cases.</li></ul><p><strong>Lesson learned:</strong> the gate isn’t an end in itself; it’s a tool to protect merges once the indicator has already proven its value.</p><p><strong>Impact on teams’ day-to-day</strong></p><p>We don’t bring absolute metrics, but we do see clear changes in daily operations:</p><ul><li>PR reviews shifted from “Do we have tests?” to “Which edge cases are we leaving alive?”</li><li>Mutation testing reports became a map to strengthen existing tests, not adding arbitrary cases just to bump coverage.</li><li>Bugs that previously surfaced only in production now show up as surviving mutants in the PR where they’re introduced.</li></ul><p>By integrating this into Fury’s standard pipelines, the capability stops being a one-team experiment and becomes an option for any product that wants to adopt it with minimal configuration.</p><h3>Conclusion and next steps</h3><p>If there’s one thing we wanted to show with this experience, it’s that <strong>coverage ≠ effectiveness.</strong> At Mercado Envíos, we tackled that gap as a platform product:</p><ul><li>A single multi-stack GitHub Action, available through Fury.</li><li>A delta-first approach so the indicator stays cheap and localized.</li><li>Actionable feedback in the PR with clear reports.</li><li>Gradual, team-by-team gates, only after the indicator has earned trust.</li></ul><p>Along the way, we faced the usual obstacles — pipeline times, equivalent mutants, flakiness, culture — and we addressed them with explicit decisions: time budgets, shared exclusions, idempotent PR comments, and the golden rule of “indicator first, gate later.”</p><p>More than chasing a higher number, we learned to have better conversations about tests. Where the pipeline used to say “all good”, it now points exactly to where an assertion is missing. That’s the shift that turns mutation testing from a demo into an everyday guardrail.</p><p>Next, we’re looking to extend this capability to more domains, deepen our impact metrics, and centralize visualizations in Fury so teams can track the health of their test suites over time.</p><p>If you’re considering mutation testing in your own context, our recommendation is simple: start small, measure the delta, make the indicator visible, and only then think about gates. The goal isn’t to kill every mutant, but to learn from the ones that survive.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ffe0a273f0e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mercadolibre-tech/mutation-testing-at-mercado-libre-from-pilot-to-everyday-guardrail-2ffe0a273f0e">Mutation testing at Mercado Libre: From pilot to everyday guardrail</a> was originally published in <a href="https://medium.com/mercadolibre-tech">Tecnología de Mercado Libre</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From a single point of failure to a cell-based architecture: How we scaled Mercado Envíos’ stock…]]></title>
            <link>https://medium.com/@luram.archanjo/from-a-single-point-of-failure-to-a-cell-based-architecture-how-we-scaled-mercado-env%C3%ADos-stock-ac57ea5011b5?source=rss-58b171af1418------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac57ea5011b5</guid>
            <category><![CDATA[database-scalability]]></category>
            <category><![CDATA[cell-based-architecture]]></category>
            <category><![CDATA[fury]]></category>
            <category><![CDATA[internaldeveloperplatform]]></category>
            <dc:creator><![CDATA[Luram Archanjo]]></dc:creator>
            <pubDate>Mon, 29 Dec 2025 18:16:09 GMT</pubDate>
            <atom:updated>2025-12-29T18:16:09.241Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IekC_RMQWvwx_-LKHCYGpw.png" /></figure><h3>From a single point of failure to a cell-based architecture: How we scaled Mercado Envíos’ stock system</h3><h3>Subtítulo</h3><p>How we migrated Mercado Libre’s second-largest MySQL instance into independent cells using Fury, reducing risk and achieving predictable scalability in Fulfillment.</p><h3>Abstract</h3><p><strong>What happens when the database supporting a continent’s logistics reaches its limits?</strong> We reached that point when a critical regional database, used for inventory operations across Latin America (LATAM), could no longer scale vertically. This article describes how we transitioned from that consolidated model to a cell-based architecture — isolating failures, reducing systemic risk, and improving operational predictability — while keeping logistics running throughout the migration.</p><h3>When a core system reaches its breaking point</h3><p>Software architecture uses patterns to prevent local failures from causing global outages. One of them is the <strong>cell-based architecture</strong>, which is conceptually similar to the naval <strong>bulkhead</strong> mechanism.</p><p>Ships use watertight compartments, or bulkheads, to divide the hull into separate sections. If one compartment floods, the others remain sealed and the ship keeps moving.</p><p>In distributed systems, we apply the same idea: each <strong>cell</strong> operates autonomously, with its own compute, database, and traffic. If one cell fails, the rest continue serving requests. This isolation reduces the blast radius and increases resilience.</p><p>This pattern became essential at Mercado Libre when the <strong>stock system powering Mercado Envíos</strong> reached its operational limit. Every inbound, outbound, reservation, and logistics movement depended on a single database that <strong>could no longer scale</strong>.</p><p>By early 2024, the question was clear:</p><p><strong>What do you do when vertical scaling is no longer an option?</strong></p><h3>The problem: One database serving all of LATAM</h3><p>Our initial architecture was simple: multiple stock services connected to a <strong>single MySQL cluster</strong>. This cluster managed:</p><ul><li>Stock availability per Fulfillment Center</li><li>Reservations for Fulfillment shipments</li><li>Logistic movements across warehouses, sellers, and destinations</li></ul><p>As volume grew, the pressure on MySQL intensified. By early 2024, we saw:</p><ul><li>CPU and I/O usage constantly at maximum</li><li>Rising latency in critical operations</li><li>Degradation spikes that were unpredictable</li></ul><p>Most importantly:<strong> a single failure could impact operations in multiple countries across the region.</strong></p><p>Operating this way was no longer sustainable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EzchCKN9hprmHDLJE2ko5A.png" /><figcaption>Image 1: Response time decreases ~70% ( — — before / — after).</figcaption></figure><h3>Why increasing the flavour wasn’t enough</h3><p>For years, vertical scaling solved our problems. But eventually, we hit new limits:</p><ul><li>There were no larger flavours available.</li><li>Traffic continued growing faster than capacity.</li><li>Relying on a single MySQL instance became a systemic risk.</li></ul><p>Scaling was no longer about adding resources. It required rethinking our architecture.</p><h3>Why we kept an intentional monolith</h3><p>Some teams would split everything into microservices, but our domain required:</p><ul><li><strong>Extremely low latency</strong>, even under peak load</li><li><strong>High availability</strong> — logistics can’t stop</li><li><strong>Strong inventory consistency</strong></li></ul><p>Multiplying network hops or points of failure would have made these constraints harder. That’s why we kept an <strong>intentional monolith</strong> at the core of the system.</p><p>For us, the key wasn’t <em>monolith versus microservices,</em> but choosing the architecture the business needed. In our case, that meant <strong>a strong, centralized core domain, surrounded by isolated cells.</strong></p><h3>The solution: From one giant to multiple cells</h3><p>We adopted a <strong>cell-based architecture</strong> to distribute load and isolate risks. Our model introduced two layers of segregation:</p><h4>1. Cells by country groups</h4><p>We grouped countries into three cells, balancing:</p><ul><li>Traffic volume</li><li>Business importance</li><li>Resilience to failures</li></ul><h4>2. Read/write separation</h4><p>We split flows into:</p><ul><li><strong>Writes:</strong> strictly consistent and business-critical</li><li><strong>Reads:</strong> more flexible, backed by replicas and caching</li></ul><p><strong>Our goal remained simple: isolate, contain, and scale.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*RHYKpv2yPF7f6sppqYiSVg.png" /><figcaption>Image 2: Isolated cells reducing the blast radius.</figcaption></figure><h3>Fury: The platform that made cell operation predictable</h3><p>Implementing cells isn’t just a technical challenge; it’s also an operational one.</p><p>How do you prevent each cell from becoming its own isolated universe with unique configs, dashboards, or deployment rules?</p><p>This is where <strong>Fury</strong>, Mercado Libre’s internal developer platform, became essential.</p><p>Fury allowed us to:</p><ul><li>Create services and databases for each cell using consistent standards</li><li>Operate independent deployment pipelines per cell</li><li>Reuse routing, observability, and configuration components</li><li>Replicate patterns, so teams don’t have to reinvent them</li></ul><p>Fury turned horizontal scaling into a <strong>repeatable, reliable process</strong>.</p><h3>Routing challenges: When your APIs have no natural key</h3><p>When we started designing routing logic for a cell-based architecture, we hit a structural limitation: several of our APIs simply didn’t include a natural key to identify which cell an entity belonged to.</p><p>Without that key, the traffic layer couldn’t deterministically route each request to the correct cell.</p><p>Introducing a new routing attribute wasn’t realistic. It would have required:</p><ul><li>Breaking compatibility with existing clients</li><li>Updating public contracts used across the company</li><li>Coordinating changes with dozens of teams and services that depended on those APIs</li></ul><p>In short, adding a routing key would have triggered a cross-organizational migration — one far more disruptive than the architectural change we were trying to implement. We needed a solution that would respect existing interfaces, even if those APIs weren’t designed for a sharded world.</p><h4>The pragmatic solution: A broadcast gateway</h4><p>When we realized several of our existing APIs had no routing key — and that introducing one would mean breaking contracts company-wide — we needed a fallback that worked <strong>without changing a single client</strong>.</p><p>For legacy entities, we implemented a pragmatic, backward-compatible routing fallback that allowed requests to be resolved without modifying existing clients. For new data, we adopted a deterministic ID strategy, so identifiers could serve as routing hints. Together, these approaches gave us a safe path to partition the dataset.</p><h3>Flow</h3><ol><li>The client makes the same request as always (no changes required).</li><li>The traffic layer forwards the request to <em>every</em> cell.</li><li>The cell holding the entity responds.</li><li>If all cells return 404, the resource truly doesn’t exist.</li></ol><p>It’s not the perfect architecture — broadcasting requests adds overhead — but it provided something more valuable: <strong>a safe migration path</strong>. It allowed us to gradually move to a cell-based model without forcing dozens of teams and clients to update their APIs overnight.</p><p>This balance of pragmatism and safety is what made the entire project viable.</p><h3>ID management: Turning IDs into routing keys</h3><p>Broadcasting solved the problem for legacy records, but we needed a deterministic routing mechanism for <em>new</em> entities — something that would scale cleanly as cells evolved and traffic grew.</p><p>The challenge was that our IDs had characteristics that worked against partitioning:</p><ul><li>They were <strong>public</strong>, part of long-standing API contracts.</li><li>They were <strong>sequential</strong>, generated by a single MySQL instance.</li><li>They had <strong>no embedded meaning</strong>, so they couldn’t indicate which cell an entity belonged to.</li></ul><p>This led to two major risks:</p><ul><li><strong>ID collisions</strong> across cells if two primaries generated overlapping numbers.</li><li><strong>No way</strong> to change the ID structure without breaking every client integration.</li></ul><h4>The solution: Assigning ID ranges per cell</h4><p>We introduced a simple but effective strategy: <strong>each cell was assigned its own exclusive ID range</strong>. Any new entity created in that cell would get an ID that could never collide with another cell.</p><p>This approach provided:</p><ul><li><strong>Collision-free generation</strong>, even with multiple independent primaries</li><li><strong>Zero breaking changes</strong>, since IDs kept their original shape</li><li><strong>Automatic routing</strong>, because the ID itself became the routing key</li><li><strong>Full transparency</strong> for clients — they didn’t need to know anything about cells</li></ul><p>With this setup, new records were easy to route, and old records were safely handled via broadcast. Using both strategies, we were able to migrate a massive, centralized system into a distributed, cell-based architecture <em>without disrupting the business</em>.</p><h3>Migrating terabytes without stopping logistics</h3><p>We migrated tens of terabytes of data into three independent cells using a carefully orchestrated cutover. Read traffic continued uninterrupted, and write operations were paused only for a brief, controlled window. Each cell’s full migration finished within a short, planned maintenance window.</p><p>During each cell’s cutover window, we executed the same playbook: copy the database into the target cell, briefly pause writes to ensure consistency, and keep all reads flowing from the original database so Marketplace and logistics traffic remained fully operational. Because most workflows are asynchronous, this short write downtime had minimal impact on end clients.</p><p>Once a cell received its data, we brought it online gradually. First, we enabled reads and validated critical flows, then allowed writes — protected by guardrails that prevented cross-cell contamination. After validation, we shifted read traffic to the new cell with zero downtime.</p><p>Each cell was migrated during its own controlled window, and all transitions completed successfully. In the year following migration, we observed a sustained reduction in infrastructure incidents and a significant improvement in platform availability.</p><h3>High availability out of the box</h3><p>Moving to a fully managed SQL service gave us a key capability we didn’t have before: <strong>replication with platform-backed consistency guarantees below 100 ms. This let us serve reads from replicas</strong>, eliminating reads on the primary, and dramatically improving scalability.</p><p>With automatic failover and replica management handled by the platform, our team no longer had to orchestrate infrastructure manually. This freed us to focus on evolving the stock domain, instead of maintaining the database.</p><h3>Impact: What actually changed</h3><p>A year after the migration, the results speak for themselves:</p><ul><li>We reduced <strong>p95/p99 latency by ~70%.</strong></li><li>We eliminated the recurring performance degradation caused by backup windows.</li><li>We shifted from scaling one giant database to <strong>scaling only the cells that need it</strong>.</li></ul><p>In short, the migration didn’t just unlock performance. <strong>It removed a systemic risk and gave us an architecture we can safely grow on</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*afDyrekkGY_s5G6C4a1SRw.png" /><figcaption>Image 3: Sharp latency drop immediately after cell split.</figcaption></figure><p><strong>Lessons learned</strong></p><p>Looking back, a few lessons stand out — not as abstract principles, but as things we experienced firsthand while reshaping a system under real constraints.</p><p>We learned that scaling isn’t just about throwing more resources at a problem; it’s about <strong>redistributing responsibility</strong> so no single component carries the weight of an entire region. We also saw the value of <strong>designing for routing from day one</strong> — a missing key can turn a simple refactor into a company-wide migration.</p><p>Sometimes, <strong>an intentional monolith is exactly what a domain needs</strong>, as long as the architecture around it is built to isolate failures and distribute load. Above all, we learned how a strong <strong>internal developer platform</strong> can turn an ambitious architectural shift into a repeatable, reliable path forward.</p><p>Each of these lessons came from solving problems we couldn’t afford to get wrong. They’ll resonate with any team standing at the edge of its current architecture.</p><h3>Conclusion: Scale isn’t a bigger box. It’s many smaller ones</h3><p>Migrating from a single MySQL instance to a cell-based architecture wasn’t just a technical refactor — it was a mindset shift. It meant challenging long-standing assumptions, carving a tens-of-terabytes monolith into independent pieces, and redesigning critical paths while the logistics engine of an entire region kept running. Hard? Absolutely. Worth it? Undeniably.</p><p>Today, we operate on an architecture that absorbs failures, scales where necessary, and behaves predictably under pressure. A year ago, a database spike could threaten operations in multiple countries. Now, a problem in one cell stays in that cell.</p><p>If your team feels “at the limit,” take this as an invitation:</p><p><strong><em>Scaling doesn’t always mean making a single system bigger. More often, it means giving it room to multiply.</em></strong></p><p>Not every architecture needs to become a giant. Sometimes, it needs to become a collection of smaller, safer, and faster pieces that unlock a future your old design could never reach.</p><h3>Acknowledgments</h3><p>This article was written with the support of <a href="https://medium.com/@luram.archanjo">Luram Archanjo</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac57ea5011b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>