Recipe: Metadata Store

MicroRaft is a strong fit for a Java metadata store when ownership records, shard maps, and control-plane state must remain strongly consistent under failure.

Typical metadata state machine

  • partition assignments and ownership transfers
  • leader leases and coordinator epochs
  • table, shard, or tenant metadata
  • feature flags or routing records that must change atomically

Why a Java Raft metadata store fits

  • metadata workloads are usually write-light and consistency-heavy
  • state is often compact enough for aggressive snapshots and fast recovery
  • embedding Raft into the control plane keeps operational dependencies small

Design rules that matter

  • keep commands deterministic, explicit, and small
  • treat metadata migrations and ownership changes as first-class commands
  • choose query consistency per endpoint instead of one read mode everywhere