← Back to Blog
System Integration 6 min

Distributed Locking in 2026: Choosing Between Redis, ZooKeeper, and etcd for Hong Kong's Mission-Critical Systems

S

S.C.G.A. Team

9 30, 2026

System Integration
Distributed Locking in 2026: Choosing Between Redis, ZooKeeper, and etcd for Hong Kong's Mission-Critical Systems

Distributed Locking in 2026: Choosing Between Redis, ZooKeeper, and etcd for Hong Kong's Mission-Critical Systems

Distributed Locking in 2026: Choosing Between Redis, ZooKeeper, and etcd for Hong Kong’s Mission-Critical Systems

Walk into any Hong Kong engineering team’s post-mortem meeting in 2026 and you will likely hear the same phrase: “It was a lock problem.” Whether it is a double-charged Octopus top-up, two warehouse robots claiming the same pallet at a Kwai Chung logistics hub, or a flash sale on a popular local e-commerce platform overselling the last iPhone, the root cause often traces back to how distributed systems coordinate access to shared resources.

Distributed locking is deceptively simple in concept—ensure only one process holds a lock at a time—but brutally difficult in practice. Networks partition, clocks drift, processes pause for garbage collection, and the CAP theorem reminds us that we cannot have everything. For Hong Kong businesses operating across AWS ap-southeast-1, Alibaba Cloud, and on-premise data centres in Tseung Kwan O and Fo Tan, the choice of locking primitive is not an academic exercise. It directly determines whether a customer sees a correct balance or a corrupted one.

This article examines the three dominant distributed locking technologies in 2026—Redis, Apache ZooKeeper, and etcd—through the lens of consistency guarantees, and explains how Hong Kong teams are deploying them in production.

Why Hong Kong’s Architecture Makes Locking Harder

Hong Kong occupies an unusual position in global infrastructure. It is simultaneously a low-latency hub for mainland China traffic and a well-connected node for Southeast Asian and global markets. A typical Hong Kong fintech platform might serve users in Causeway Bay with sub-10ms latency while replicating data to Singapore and Shenzhen. That topology creates consistency challenges that a single-region US deployment simply does not face.

Cross-border data flows add regulatory complexity. The Personal Data (Privacy) Ordinance (PDPO) constrains where certain data can reside, while mainland China’s data export rules affect how telemetry and logs traverse the border. Teams often end up with split-brain-adjacent topologies: a primary cluster in Hong Kong, a read replica in Singapore, and a compliance-mandated copy in Shenzhen. Every lock acquisition now has to reason about which of these regions is authoritative.

Add to this the operational realities of Hong Kong: occasional submarine cable incidents in the South China Sea, typhoon-season network degradation, and the fact that many enterprises still run hybrid workloads across HKEX-adjacent colocation facilities and public cloud. The locking mechanism you choose must survive all of this without silently corrupting state.

Redis: Speed, Familiarity, and the Redlock Debate

Redis is the default choice for most Hong Kong startups, and for good reason. It is fast, operationally simple, and every engineer already knows it. The SET key value NX PX 30000 command gives you a basic lock with a TTL in a single round trip, and libraries like Redisson wrap this into a usable RLock API with watchdog-based renewal.

The problem is that Redis’s default replication is asynchronous. When a client acquires a lock on the primary, that write may not have propagated to replicas before the primary fails. A replica gets promoted, the lock disappears, and a second client acquires it—classic split-brain. This is not a theoretical concern. In 2023, a Hong Kong digital wallet provider suffered a double-spend incident during a failover event that took roughly 1.4 seconds; the post-mortem pointed directly at single-instance Redis locks with async replication.

The Redlock algorithm, proposed by Redis creator Salvatore Sanfilippo, attempts to address this by requiring a majority of independent Redis nodes to grant the lock. But Redlock has been heavily criticised—most notably by Martin Kleppmann—for relying on bounded clock drift and having no fencing tokens. In 2026, the consensus among careful Hong Kong architects is pragmatic: use Redis locks for efficiency and coordination, never for correctness. If a lock failure could cause financial loss, pair Redis with an idempotency layer or a fencing token checked at the storage layer.

Where Redis shines is in high-throughput, low-stakes locking: rate limiting, cache stampede prevention, deduplicating webhook processing, and coordinating background jobs. A Hong Kong media company we work with uses Redis locks to ensure only one worker regenerates a popular news homepage cache at a time—a use case where occasional double-execution is harmless.

ZooKeeper: The Battle-Tested Consensus Workhorse

Apache ZooKeeper has been the reference implementation for distributed coordination since the late 2000s. It uses the Zab consensus protocol to maintain a replicated state machine, and its ephemeral sequential nodes give you a natural locking primitive: create an ephemeral node under a lock path, and the lowest sequence number holds the lock. Session expiry automatically releases locks held by dead clients.

ZooKeeper’s consistency guarantees are strong. Writes are linearizable, and reads can be made so with a sync() call. There are no silent lock losses during failover because a majority of the ensemble must agree on every write. For Hong Kong financial institutions—particularly those with roots in the banking sector where ZooKeeper has powered Kafka, HBase, and Solr for over a decade—this reliability is not negotiable.

The trade-offs are real, though. ZooKeeper is operationally heavy: you need an odd-numbered ensemble (typically three or five nodes), JVM tuning, and someone who understands what happens during a leader election. Latency for a lock acquisition is typically 5–15ms within a Hong Kong region, which is fine for many workloads but slower than Redis. And the ecosystem momentum has clearly shifted—new adopters in 2026 rarely pick ZooKeeper for greenfield projects.

Still, plenty of Hong Kong systems run on it. A cross-border payment processor we advise uses ZooKeeper for its settlement ledger locks, precisely because the team values the “no surprises” consistency model and already runs a five-node ensemble across Hong Kong and Singapore for Kafka.

etcd: The Modern Default for Kubernetes-Era Infrastructure

etcd emerged from the CoreOS ecosystem and became the backbone of Kubernetes. It implements the Raft consensus algorithm, exposes a clean gRPC API, and offers leases and transactions that map neatly onto distributed locking. A lock in etcd is a lease attached to a key, created with a compare-and-swap transaction—if the key already exists, your transaction fails and you retry.

For Hong Kong teams running Kubernetes on AWS EKS, Alibaba ACK, or GKE, etcd is often already in the stack. That familiarity lowers the adoption barrier considerably. The clientv3/concurrency package provides a Mutex type that handles the tricky parts—lease keep-alives, waiting queues, and fair ordering—so you do not have to reimplement them.

etcd’s consistency guarantees sit between Redis and ZooKeeper in practical terms, but lean strongly toward correctness. Raft ensures linearizable reads and writes when you use the right options, and the lease mechanism means locks expire automatically when the client stops heartbeating. A Hong Kong ride-hailing platform we worked with migrated its driver-dispatch locking from Redis to etcd after a series of duplicate-assignment bugs. The migration cut duplicate assignments to zero over six months of production, at the cost of roughly 8ms additional lock latency—an acceptable trade for correctness.

The main caution with etcd is that it is not designed for high write throughput. If you are acquiring and releasing locks thousands of times per second, you will stress the cluster. Use it for coordination, not for hot-path contention.

A Practical Decision Framework for Hong Kong Teams

So how should a Hong Kong engineering team choose in 2026? The honest answer is that it depends on the cost of being wrong.

Start by classifying your locks. Efficiency locks prevent wasted work—cache regeneration, duplicate job execution, rate limiting. These tolerate occasional double-acquisition, so Redis is ideal: fast, cheap, and simple. Correctness locks protect invariants—account balances, inventory counts, seat reservations, settlement state. These require consensus, so choose ZooKeeper or etcd.

Next, consider your existing infrastructure. If you already run Kubernetes and etcd, use etcd. If you already run Kafka and ZooKeeper, use ZooKeeper. Introducing a new consensus system just for locking adds operational burden that few Hong Kong teams—already stretched thin—can absorb.

Then, layer in defence. Even with strong consensus, network partitions can cause a client to believe it holds a lock while the rest of the cluster disagrees. Use fencing tokens: monotonic numbers issued with each lock, checked by the resource being protected. This is the pattern Kleppmann recommends, and it is what separates a robust system from a fragile one. A Hong Kong stock-broking client uses fencing tokens on every order-book mutation, so even a stale lock holder cannot corrupt the book.

Finally, monitor lock contention as a first-class metric. Lock wait times, acquisition failures, and lease renewal errors are leading indicators of trouble. If your p99 lock acquisition time creeps above 50ms in a Hong Kong region, something is wrong—either contention, network issues, or a misconfigured lease.

Conclusion: Consistency Is a Business Decision

Distributed locking is not just an engineering detail; it is a business decision about how much inconsistency your organisation can tolerate. A Hong Kong marketing site can afford occasional duplicate emails. A Hong Kong clearing house cannot afford duplicate settlements. The technology you choose should reflect that distinction honestly.

Redis remains the pragmatic choice for speed-sensitive, low-stakes coordination. ZooKeeper remains the battle-tested workhorse for teams already invested in its ecosystem. etcd has become the modern default for Kubernetes-native infrastructure and offers an excellent balance of correctness and operational simplicity. None of them is universally right, and any of them can be wrong if deployed without fencing, monitoring, and a clear-eyed view of what failure actually costs.

As Hong Kong’s systems grow more distributed—across borders, clouds, and regulatory regimes—the teams that succeed will be the ones that treat locking as a design discipline rather than a library call. Choose deliberately, defend in depth, and never assume the lock is held just because your code says so.

Enjoyed this article? Share it!

Share:

🎙️ Listen to this episode

Subscribe to Our Newsletter

Get the latest insights delivered to your inbox