Skip to main content

54 posts tagged with "Clustron"

Articles related to Clustron distributed key-value store.

View All Tags

Two Regions, Both Writable: Conflict Resolution with Hybrid Logical Clocks

· 11 min read
Clustron Team
Distributed Systems Engineering

Geographic redundancy starts as an availability requirement and quickly becomes a consistency problem. The availability part is easy to state: if a region goes dark, the application should keep serving from another one. The naive implementation is a primary region that owns all writes and a secondary that replicates and serves reads. It survives a read-region outage gracefully, but it has two sharp edges. Every writer, wherever they are, pays the latency to reach the one primary — a user in Sydney writing to a primary in Virginia feels every one of those milliseconds. And when the primary fails, you are not serving degraded; you are promoting a standby under pressure, hoping the last few writes made it across before the lights went out.

Active-active removes both edges by making every region a first-class writer. A user writes to the region nearest them, reads from the region nearest them, and the regions reconcile in the background. No write pays an intercontinental round-trip, and no failover needs a promotion ceremony, because there was never a single primary to lose. The price of this is the problem active-active exists to solve and single-primary setups get to pretend does not exist: two regions can write the same key at the same time, and the system must decide, deterministically and identically everywhere, which write wins.

Zaris runs active-active as two independent clusters — not one cluster stretched across an ocean — linked by asynchronous replication, with conflicts resolved by a hybrid logical clock and last-writer-wins. This post is about why those three choices go together, and what "last writer" has to mean when there is no clock everyone can trust.

Refusing to Wipe Yourself: RESP Safety When No Password Is Set

· 10 min read
Clustron Team
Distributed Systems Engineering

There is a well-worn genre of outage story that always opens the same way: a cache was stood up for a quick test, the Redis-protocol port was left on the default bind, no password was set because it was "just a test," and somewhere between a few minutes and a few days later every key was gone. Sometimes it is a misconfigured service discovery pointing production traffic at the test box. More often it is a background scanner on the public internet that found an open port, spoke the protocol, and sent FLUSHALL because that is exactly what the scanners are written to do. The store did what it was told. It had no reason not to — nobody had told it to be careful.

That failure is not really a Redis bug; it is a default. A data store that speaks an unauthenticated protocol and binds to every interface the moment it starts has made a choice on your behalf, and the choice is "trust whoever can reach the socket." For a local development convenience that is fine. For anything with a routable address it is a standing liability, and the liability is worst in the exact window where it is least watched: the first few minutes of a new deployment, before auth is wired up, when the store is already listening and already destroyable.

Zaris inverts that default. When the RESP (Redis-protocol) endpoint is enabled but no password is configured, the store does two things without being asked: it binds the listener to loopback only, and it refuses the commands that can irreversibly destroy data. You have to opt out of that safety to get the wide-open behaviour, and opting out is explicit and auditable. This post is about what that hardening is, where it lives, and how to lift it on purpose.

A Zaris Cluster on Windows, Without a Container in Sight

· 10 min read
Clustron Team
Distributed Systems Engineering

The default story for running a distributed data store in 2026 is a container story. The quickstart hands you a Dockerfile, the production guide hands you a Helm chart, and the implicit assumption is that somewhere underneath there is a Linux kernel and an orchestrator. For a great many teams that assumption holds. For a great many others it simply does not: a fleet of domain-joined Windows Servers, a change-control process that treats a new container runtime as a six-week project, a security posture that wants services registered with the Service Control Manager where the existing tooling can see them. These are not teams that are behind the times. They are teams whose times are different, and a store that can only be run as a container is, to them, a store that cannot be run at all.

Zaris runs natively on Windows. Not in a Linux VM, not in a container on Windows, but as an ordinary Windows service that the Service Control Manager starts, the event log watches, and the existing fleet management already knows how to patch. The cluster forms over PowerShell cmdlets, the data plane speaks the same protocols it speaks everywhere, and nothing in the path wants Docker. This post walks the shape of a two-node native deployment and flags the two things that are not obvious — the ones that turn a ten-minute setup into a lost afternoon.

Deploying Zaris on EKS: the Helm OCI Chart and the Replica-Placement Trap

· 9 min read
Clustron Team
Distributed Systems Engineering

The friction of running a data store on Kubernetes used to start at installation. You added a Helm repo, hoped it stayed online, and reconciled chart versions by hand. That part is now trivial: the Zaris chart ships as an OCI artifact in a container registry, so installing it is the same kind of pull as pulling an image — no repo list, no helm repo update, just a reference and a version. On EKS, where you already have a registry and an IAM story, that removes the last bit of bespoke setup.

What does not become trivial, and what no helm install output will warn you about, is placement. A distributed store's whole availability promise rests on one assumption: that the copies of a piece of data live on different failure domains, so losing one does not lose the data. Kubernetes does not know that assumption exists unless you tell it. Left to its defaults, the scheduler optimises for bin-packing and indifference — and it will quite happily schedule a partition's primary pod and its replica pod onto the same EKS node. When that node is drained for an upgrade or lost to a spot reclaim, both copies go with it, and the replication factor you carefully set to 2 bought you exactly nothing.

This post does the EKS deployment end to end, then spends most of its time on the placement trap, because that is the part that turns a green cluster into a real one.

Zaris 2.2.0: The Resilience Release

· 8 min read
Clustron Team
Distributed Systems Engineering

There are two kinds of release. One adds capabilities — new commands, new data structures, a new API surface. The other removes failure modes, and from the outside it can look like nothing happened at all, because the whole point is that things which used to go wrong now quietly do not. Zaris 2.2.0 is firmly the second kind. It ships no headline new feature; it ships a cluster that survives a specific set of failures it previously survived badly or not at all.

Those failures share a theme, which is why they landed together: they are the dishonest ones. A TCP connection that is dead but reports itself alive. A Redis-protocol port that is open and unauthenticated and will cheerfully destroy your data if asked. A write that was acknowledged as safe but had not yet been made durable when the owner changed. Each of these is a gap between what the system said was true and what was true, and each is the kind of gap that stays invisible until the worst possible moment. 2.2.0 closes them.

This post is the tour. Two of the three changes have standalone deep-dives already; this is the map that shows how they fit, plus the upgrade details.

When a Connection Lies: Detecting and Healing Half-Open TCP in a Cluster

· 10 min read
Clustron Team
Distributed Systems Engineering

The cleanest way to lose data in a distributed system is not a crash. A crash is loud: the socket resets, the peer notices, failover kicks in, everyone agrees something happened. The quiet way is a connection that dies without telling anyone. One node keeps writing replication traffic into a TCP socket, the writes return success, the send buffer fills, and on the other end there is simply no one listening anymore — a peer that was network-partitioned, a middlebox that silently dropped the flow, a kernel that reset the far side while this side never got the memo. Nothing throws. Nothing logs an error. The connection is half-open, and it will stay that way, cheerfully accepting bytes that go nowhere, until something forces the issue.

For a store that replicates over TCP, this is the failure that matters most, because it is invisible at exactly the layer you would normally trust. socket.Connected is true. The write call succeeds. The health check — if it rides the same control channel — may even pass, because the control channel reconnected while the data channel stayed wedged. Meanwhile a partition's owner is trying to ship updates to its replica, the frames pile up in a send queue that never drains, and the replica falls further behind on every write. No alarm, no exception, just a backlog growing toward a cliff.

Zaris 2.2.0 ships the transport-layer fix for this, and the interesting part is not the reset — resets are easy — it is the detection. You cannot ask a half-open socket whether it is alive; it will lie. So the question becomes: what is the one symptom a wedged connection cannot fake?

Jobs That Survive a Crash: A Durable Work Queue on Zaris Streams

· 16 min read
Clustron Team
Distributed Systems Engineering

Almost every service grows a background queue. A request comes in, you do the fast part inline — validate, write a row, return 202 Accepted — and you hand the slow part to a worker: render the PDF, charge the card, send the email, re-index the document. Enqueuing is the easy half. The hard half is the promise you have quietly made to the caller: this job will actually run, even if a worker falls over in the middle of it.

That promise is where naive queues break. The usual first cut is a list: push a job on one end, have workers pop from the other. It works beautifully until a worker pops a job, begins the work, and then the process is killed — a deploy, an OOM, a node reboot. The job was removed from the list the instant it was popped, so it exists nowhere now except in the memory of a process that no longer exists. No error, no retry, no trace. The caller got their 202 and the work silently never happened.

A durable work queue needs three properties a pop-from-a-list queue does not have: a job is delivered to exactly one worker at a time, it stays owned-but-unfinished until that worker explicitly confirms completion, and if the worker never confirms, the job becomes claimable by another worker. Zaris streams with consumer groups give you all three as first-class server-side behaviour. This post builds the queue on them, verified against the shipping native .NET API.

One Event, Every Screen: Live Fan-Out with Zaris Pub/Sub

· 14 min read
Clustron Team
Distributed Systems Engineering

Live features look simple on a laptop. A price moves, a game scores, an order ships — you raise an event, your WebSocket handler pushes it to the connected clients, and the screen updates. It keeps working right up until the moment there is more than one copy of your app. Then it quietly breaks, and it breaks in a way that is easy to miss in testing because a single instance always looks fine.

The reason is that an in-process notification — a C# event, an IObservable, a Channel<T> — only reaches code running inside the same process. Put four instances of your API behind a load balancer and the browser sessions spread across all four. A price tick that arrives on instance A raises an event on instance A, which pushes to the sockets instance A is holding. The three-quarters of your users connected to B, C, and D see nothing. The update is real, it just never leaves the process that heard about it.

The fix is a broker that carries the event across instances: one component publishes, every instance that holds interested clients receives, and each forwards to its own sockets. That is exactly what publish/subscribe is for, and Zaris ships it as a first-class native .NET API — IPubSubClient — with one property that makes it right for this job: a message published on any node in the cluster is delivered to subscribers connected to any node, exactly once. This post builds a live fan-out on it, verified against the shipping API.

Ranked in One Hop: Real-Time Leaderboards on Native Sorted Sets

· 13 min read
Clustron Team
Distributed Systems Engineering

A leaderboard looks trivial until it has to be live. Players earn points constantly, and at any instant you need to answer three questions fast: what are the top ten, what's this player's rank, and who is just above and below them. On a single process with a few hundred players you can keep a list, sort it, and move on. The moment the board is big, busy, and spread across more than one app instance, the naive shapes fall apart in two different ways.

Keep the board in each instance's memory and you have the same problem every stateful-in-process design has: four instances, four different ideas of who's in first. A score earned on instance A is invisible to instance B until something reconciles them, and nothing does. Push the board into a SQL table instead and the correctness problem goes away, but now every "top ten" is an ORDER BY score DESC LIMIT 10 over a table that's being written to on every single point scored, and every "what's my rank" is a COUNT(*) WHERE score > mine. Those queries re-sort or re-scan on each call. Under real traffic that is the most expensive thing in your system, and you end up bolting a cache in front of it that is immediately stale.

The data structure that fixes this is a sorted set: a collection of unique members, each with a score, kept permanently in score order so that rank is an index, not a computation. Redis made it famous. Zaris ships it as a first-class native .NET type — ISortedSetClient — with the ordering maintained on the server as scores change, so a point scored is one atomic increment and the top ten is one range read. This post builds a working leaderboard on it, verified against the shipping API.

Sessions That Survive the Next Deploy: ASP.NET Core Session State on Zaris

· 11 min read
Clustron Team
Distributed Systems Engineering

Session state is the thing you forget is stateful. You call HttpContext.Session.SetString(...) to stash a cart, a wizard step, an anti-forgery nonce, a "you just added 3 items" flash message — and on a single process it just works, because the default session store is a dictionary in that process's memory. Then you add a second instance behind a load balancer, and it stops working in a way that is maddening to debug: most requests are fine, but every so often a user's cart is empty, their multi-step form resets, or they're bounced to the login page. The reason is simple once you see it — their session lives in instance A's memory, and that request landed on instance B, which has never heard of them.

The usual patch is sticky sessions: configure the load balancer to pin each client to the instance that first served them. It makes the symptom go away, but it doesn't make the state shared — it just hides the fact that it isn't. Sticky routing means your load balancing is now lopsided, a rolling deploy logs out everyone pinned to the pod being replaced, autoscaling-in drops whoever was pinned to the terminated instance, and a single crash takes every session on that node with it. You haven't made sessions durable across instances; you've made each instance a single point of failure for its own users.

The real fix is to put the session bytes somewhere every instance can see, so routing stops mattering. Zaris ships exactly that as a first-class ASP.NET Core integration — Clustron.Zaris.AspNetCore.Session — and it is one call at startup. This post shows the whole wiring, verified against the shipping package, and the one thing it does that a plain distributed cache does not: slide the idle timeout on every request.