---
topic: systems-architecture
author: Crashtech Editorial
published: Nov 15, 2026 · read: 6 min
---

How Reddit Migrated Its Comments Backend from Python to Go Without Switching Blind

Reddit’s engineering team used tap-compare reads and isolated sister datastores to validate a high-write Go migration while Python remained the production path.

– –
Comment cards split into separate production and isolated test-store paths that rejoin at a comparison gate.
Conceptual illustration of Reddit’s tap-compare and sister-datastore migration approach.

A service rewrite becomes dangerous when the new implementation is allowed to write to the same critical records before anyone knows whether its behavior matches the old one. Reddit’s comments migration shows how the verification strategy can be designed around that risk instead of relying on a big-bang traffic switch.

In an engineering post, Reddit says its Comments, Accounts, Posts and Subreddits models were served from a legacy Python service with ownership divided across teams. The comments model was chosen first because it had the highest write throughput among those core models. The goal was to move critical read and write paths into domain-specific Go services while maintaining performance and availability parity. [1]

Reads: compare answers while users see the old path

For read endpoints, Reddit describes a method it calls tap compare. A small share of traffic reaches the new Go endpoint. The new path calls the legacy Python endpoint, compares the two responses and logs differences, but still returns Python’s response to the user. That lets engineers examine behavior under real production inputs without exposing users to an unverified result. [1]

This is more than shadowing requests. A useful comparison must normalize fields that are expected to differ, capture enough context to reproduce mismatches, and distinguish response differences that matter from harmless serialization or ordering changes. Reddit’s post focuses on the approach it used; the details of comparison policy belong to each service’s data contract.

Writes: isolate the new implementation’s side effects

Write validation is harder because the comments path touches three data stores: Postgres for comment data, Memcached for caching, and Redis for change-data-capture events. Reddit says those CDC events are consumed by other critical services and must be delivered without gaps or delays. Duplicate writes to production stores were not an option because comment identifiers have unique-key constraints. [1]

The solution was to provision three “sister datastores” used only for tap-compare testing. A small share of write traffic reached Go, which first called Python to perform the real production write. Go then made a second write into the isolated sister stores. The team compared what Python had written in production with what Go produced in the clones. The new implementation could make mistakes without corrupting the user-facing data. [1]

Reddit says it migrated three write endpoints—create comment, update comment and increment comment properties. Each interacted with three data stores and was compared across two service implementations, yielding 18 comparison paths. That count illustrates how a seemingly local endpoint can have a broad correctness surface once caches and events are included. [1]

Compatibility bugs appear between services

The team found serialization issues where Python consumers could not deserialize events written by Go. To test more than the final database rows, Reddit ran tap-compare checks through the existing Python CDC event consumers. This exercised the cross-language path that downstream services actually depended on. [1]

The post also discusses database pressure that emerged when Go replaced some behavior previously provided by Python’s ORM. Reddit says the team spotted the increase while ramping traffic and optimized the Go queries. That is a useful reminder that replacing a library can also remove hidden query behavior, batching or optimizations; matching business logic does not guarantee matching database load.

Performance came after safe verification

After the migration, Reddit says all comment endpoints were served by the new Go microservice without disruption. It reports that the three migrated write endpoints roughly halved p99 latency, while noting that the legacy Python service had occasional spikes up to 15 seconds. These are Reddit’s results for the endpoints it describes—not proof that Go is inherently faster for every workload. [1]

The method is portable: compare reads while returning the established answer; isolate writes when dual-writing production is unsafe; validate downstream consumers; and ramp traffic only when mismatch and resource signals are understood. The DoorDash mesh migration also shows how teams can move infrastructure gradually around critical paths. Language choice matters, but the verification system is what made this particular rewrite safe to learn from.

Compare side effects, not only response bodies

A read comparison can often run without changing data. A write comparison has to account for everything the old endpoint changes: the durable record, caches, event streams, and any consumers that react to those events. Reddit’s three-store design made that concern concrete. A write that updated Postgres but emitted a different Redis event could leave the core row looking correct while downstream systems diverged. [1]

Sister datastores limited the blast radius. Python performed the real user-facing write; Go wrote an equivalent representation into isolated stores. The comparison could then inspect both persisted state and event consumption without allowing an unverified implementation to overwrite production records. Reddit says the legacy Python CDC consumers were used to detect serialization mismatches, which tests compatibility at the boundary between the two languages rather than only validating the Go service in isolation. [1]

This technique has costs: the test environment must mirror relevant schemas and data behavior, comparison logs need a way to triage mismatches, and operating parallel writes consumes resources. It also does not automatically prove correctness for every possible event or concurrency order. But it gives engineers a way to learn from real-shaped traffic while keeping the incumbent path authoritative.

Mismatch debugging can expose hidden contracts

Reddit says Python’s ORM had behavior that its Go implementation initially did not reproduce, resulting in database pressure when Go traffic ramped up. That is a classic rewrite hazard: an abstraction may hide query choices, batching or transaction details that have become part of the service’s operational contract. The team reports detecting the pressure early and optimizing its Go queries. [1]

The source also describes a race condition that produced false mismatches in tap-compare logic. In concurrent comment updates, the two implementations could observe data at slightly different points in time. A comparison system has to understand which values should be identical, which may change between reads, and how to correlate a request with the resulting records and events. [1]

Measure the endpoint and the migration separately

Reddit reports p99 latency was roughly halved for the three migrated write endpoints, but its stated primary goal was moving critical paths while maintaining performance and availability parity. Keeping those points separate avoids turning a migration case study into the unsupported claim that changing languages always improves latency. The reported result applied to particular endpoints, queries, data stores and production conditions. [1]

For teams planning a similar move, record user-visible behavior, datastore writes, event delivery, database load and tail latency throughout the ramp. A service is ready to take traffic when those measures agree—not simply because the new implementation returns the same happy-path response in a unit test.

Advertisement

Frequently asked questions

How did Reddit compare a new Go read endpoint with its Python endpoint?

Reddit describes tap-compare testing: send a small share of traffic to the Go endpoint, call the legacy Python endpoint, compare responses, log mismatches, and return the Python response to the user during validation.

Why did Reddit use sister datastores for comment writes?

The comment path writes to Postgres, Memcached and Redis, and duplicate production writes were not safe. Reddit created isolated sister stores for Go shadow writes and compared them with the production writes made by Python.

What performance result did Reddit report?

Reddit says the migrated three write endpoints had roughly half the p99 latency of the legacy Python endpoints. This is the company’s report for those endpoints, not a general claim that Go is always faster than Python.

Sources & further reading

/* Comments */