ExESDB.System (ex_esdb v0.1.5)

This module is the top level supervisor for the ExESDB system.

It uses a layered supervision architecture for better fault tolerance:

SINGLE NODE MODE:

  1. CoreSystem: Critical infrastructure (PersistenceSystem + NotificationSystem + StoreSystem)
  2. GatewaySystem: External interface with pooled workers

CLUSTER MODE:

  1. CoreSystem: Critical infrastructure (PersistenceSystem + NotificationSystem + StoreSystem)
  2. LibCluster: Node discovery and connection (after core is ready)
  3. ClusterSystem: Cluster coordination and membership
  4. GatewaySystem: External interface (LAST - only after clustering is ready)

NotificationSystem (part of CoreSystem) includes:

  • LeaderSystem: Leadership responsibilities and subscription management
  • EmitterSystem: Event emission and distribution

IMPORTANT: Core functionality (Store, Persistence) must be fully operational before any clustering/membership/registration components start. This ensures the server is ready to handle requests before announcing itself to the cluster.

In cluster mode, GatewaySystem starts LAST to prevent external connections until the entire distributed system is properly initialized.

Note: Store management is now handled by the distributed ex-esdb-gater API.

Summary

Functions

Returns a specification to start this module under a supervisor.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start(opts)

start_link(opts)

stop(reason \\ :normal)