Free forever, no credit card.Get Started for Free →
← All posts
November 30, 2026 · 5 min read

Does ZooKeeper Remember Between Runs? Persistent Znodes Survive. Ephemeral Ones Vanish With the Session.

Does ZooKeeper Remember Between Runs? Persistent Znodes Survive. Ephemeral Ones Vanish With the Session. ZooKeeper remembers between runs, but it remembers in two opposite ways at once, and which one applies depends entirely on a choice made at creation time. Apache ZooKeeper is a coordination service: a small, replicated tree of data nodes, called znodes, that distributed systems use to agree on configuration, membership, locks, and who is currently in charge. Persistent znodes survive client

Does ZooKeeper Remember Between Runs? Persistent Znodes Survive. Ephemeral Ones Vanish With the Session.

ZooKeeper remembers between runs, but it remembers in two opposite ways at once, and which one applies depends entirely on a choice made at creation time. Apache ZooKeeper is a coordination service: a small, replicated tree of data nodes, called znodes, that distributed systems use to agree on configuration, membership, locks, and who is currently in charge. Persistent znodes survive client disconnects and server restarts until someone deletes them. Ephemeral znodes are deleted automatically the moment the session that created them ends. Same tree, same write path, two completely different memory lifetimes, and the difference is deliberate.

Layer one: persistent znodes and the replicated tree

Data in ZooKeeper lives in a hierarchical namespace that looks like a filesystem, with slash-separated paths such as /kafka/config/topics. Unlike a filesystem, every znode can hold data and have children at the same time. Each znode also carries a stat structure: version numbers for data and ACL changes, timestamps, and transaction IDs for creation and last modification. Every time a znode's data changes, its version increments, and a client updating or deleting it can supply the version it read; if the versions do not match, the update fails. That gives the tree a built-in compare-and-set discipline.

The whole tree is replicated across an ensemble of servers through ZAB, ZooKeeper's atomic broadcast protocol. One elected leader orders every write, a majority of the ensemble must acknowledge it, and the data is logged durably and captured in periodic snapshots. Restart a server, lose a minority of the ensemble, reconnect a client tomorrow, and the persistent znodes are still there with the same values and versions. As coordination memory, this is strong: small facts, agreed in the same order by every observer, kept across restarts by design.

Layer two: ephemeral znodes are memory with a heartbeat

A ZooKeeper client holds a session with the ensemble, identified by a session ID and kept alive by periodic heartbeats, with a timeout negotiated in milliseconds. An ephemeral znode is owned by the session that created it. While the session lives, the znode exists. When the session ends, whether the client shut down cleanly or simply stopped being heard from past the timeout, ZooKeeper deletes every ephemeral znode that session owned, automatically, with no cleanup job required.

That deletion is a feature, and it powers the classic recipes. A service registers itself under an ephemeral node, so its presence in the tree means it is actually alive right now. A lock is an ephemeral sequential znode: ZooKeeper appends a ten-digit sequence number at creation, the lowest-numbered holder owns the lock, and a crash releases it because the session dies and the node disappears. Leader election reads the same pattern differently. Ephemeral memory is not a record of what happened. It is a live statement about what is true at this moment, and it erases itself the moment it stops being true.

Layer three: watches notify once, then forget they were watching

Clients learn about changes through watches. A client sets a watch while reading a znode, and when that znode's data or children change, ZooKeeper sends one notification and clears the watch. To be notified again, the client must read again and set a new watch. Watches are also tied to the session: when a session expires, its watches are removed with it.

For coordination, one-shot watches are enough, because the reaction to a change is usually immediate: re-read, re-check who holds the lock, proceed. For memory, the shape matters. A watch is not a history and not a subscription log. Nothing in ZooKeeper accumulates a readable account of every change a watcher saw, in order, for a later run to review. The notification fires, the moment passes, and the tree holds only the current state that resulted.

The size limit that defines the job

ZooKeeper was not designed as a general data store, and its limits say so plainly. The data at each znode is read and written atomically as a whole, payloads are capped at about 1 MB, and in practice values should stay at a few kilobytes, because the entire tree is held in memory on every server. Configuration values, membership entries, lock markers, leader identities: coordination-sized facts, kept consistent at all costs. There is no slot in a znode for a conversation, a chain of reasoning, a rejected alternative, or the notes from the run that set the value.

What a scheduled agent actually gets back

Put an automation on top of ZooKeeper and the split becomes practical. The agent can read the current configuration, see which services are registered right now, and learn who won the last election. It cannot read why the configuration was changed last Tuesday, what the previous run tried before choosing that value, or what a different tool concluded in a separate session, because none of that was ever written to the tree, and the ephemeral half of the tree is designed to vanish between sessions anyway. The agent starts each run with the current state of the system and none of the reasoning that produced it.

That reasoning gap is the one Vilix AI is built to close. Vilix AI is a cloud-hosted memory layer for AI agents: zero infrastructure to run, no ensemble to size, monitor, or snapshot. Every tool and agent connects to the same memory over MCP, so a scheduled workflow, a coding assistant, and a chat session all read and write one shared record instead of separate stores. It keeps the full conversation history, not just extracted facts or final values, so the reasoning behind a decision is still there when the next run goes looking for it. A run starts by reading what previous runs actually said and did, and ends by saving its own work into the same record.

The practical split is simple. Keep coordination state in ZooKeeper, where persistent znodes, sessions, and watches are the right tools for small facts that must agree everywhere and expire when their owner dies. Keep agent memory in Vilix AI, where the full history is the point. Vilix AI has a free plan that stays free forever, a 7-day Pro trial that needs no card, and export and delete controls available anytime, so the record an agent builds stays portable. ZooKeeper will keep remembering your cluster's present between runs. Give your agents a memory that keeps the rest of the story too.

Get Started for Free

Persistent memory across ChatGPT, Claude, and the AI tools you already use in Vilix AI.

Get Started for Free

Free forever, no credit card.

Keep reading
Does Azkaban Remember Between Runs? The History Is Kept. The Reasoning Is Not.

Does Azkaban Remember Between Runs? The History Is Kept. The Reasoning Is Not. Azkaban remembers that a flow ran, when it ran, whether it succeeded, and what it printed to its logs. It does not remember what the work inside the flow learned. Each new execution starts from the project files, the schedule, and whatever parameters are handed in at launch. If a step inside that flow is an AI agent, the agent wakes up with a job definition and no past: none of the findings, decisions, or open questi

Does Apache Ignite Remember Between Runs? The Grid Holds Data. The Agent Starts Empty.

Does Apache Ignite Remember Between Runs? The Grid Holds Data. The Agent Starts Empty. Apache Ignite remembers the data placed in its caches, and with one optional setting it remembers that data across a full cluster restart. Without that setting it remembers nothing once the cluster stops. Either way, what Ignite holds is current data under keys and in tables. It does not hold a run: what a scheduled AI agent checked, concluded, or promised to do next. An automation that wakes tomorrow can que

Does Hazelcast Remember Between Runs? The Map Holds Values. The Agent Starts Empty.

Does Hazelcast Remember Between Runs? The Map Holds Values. The Agent Starts Empty. Hazelcast remembers exactly what its data structures were told to hold, for exactly as long as the cluster, a backup, or an optional persistence layer keeps them alive. An IMap entry put by one process can be read by another process seconds or days later, as long as the cluster stays up or the entry was written through to an external store. What Hazelcast never holds is a run. It stores current values under keys