How childax/stadvdb-mco2-ddb works
This is a three-node distributed database transaction-management application. Users inspect cluster health and train services through a React frontend and Express API; service reads are resolved transparently across nodes, while writes are routed to the central copy and the owning date fragment. Internally, sharding, SQL transactions, replication, and pending-replication logging support that workflow. The README also describes concurrency and crash-recovery capabilities, but sampled code shows recovery logging hooks rather than complete replay, and the frontend is explicitly a scaffold. Links reflect shown calls or documented capabilities; unsampled recovery behavior is not inferred.
Main entry points: db.js MySQL Pools · replication.js Distributed Writes · sharding.js Fragment Routing · cluster.js Cluster Status API
Components 13
Application Entry
- React UI
frontend/src/App.jsx - UI Bootstrap
frontend/src/main.jsx - Express Server
backend/src/index.js
API And Routing
- Cluster Status API
backend/src/routes/cluster.js - Service CRUD API
backend/src/routes/services.js
Transaction Management
- Fragment Routing
backend/src/utils/sharding.js - Distributed Writes
backend/src/services/replication.js - SQL Transactions
backend/src/services/concurrency.js - Pending Write Log
backend/src/services/recovery.js
Distributed Storage
- Node Configuration
backend/src/config/nodes.js - MySQL Pools
backend/src/config/db.js - Three MySQL Nodes
db/schema.sql
Other components
- User
Connections 17
- User → React UI: uses
README.md - UI Bootstrap → React UI: renders
frontend/src/main.jsx - Express Server → Cluster Status API: mounts
backend/src/index.js - Express Server → Service CRUD API: mounts
backend/src/index.js - MySQL Pools → Node Configuration: loads settings
backend/src/config/db.js - MySQL Pools → Three MySQL Nodes: connects
backend/src/config/db.js - Cluster Status API → MySQL Pools: checks nodes
backend/src/routes/cluster.js - Cluster Status API → Fragment Routing: reports rule
backend/src/routes/cluster.js - Service CRUD API → Fragment Routing: routes reads
backend/src/routes/services.js - Service CRUD API → Distributed Writes: dispatches writes
backend/src/routes/services.js - Fragment Routing → MySQL Pools: queries nodes
backend/src/utils/sharding.js - Distributed Writes → Fragment Routing: selects targets
backend/src/services/replication.js - Distributed Writes → SQL Transactions: runs transactions
backend/src/services/replication.js - Distributed Writes → Pending Write Log: logs failures
backend/src/services/replication.js - SQL Transactions → MySQL Pools: opens connections
backend/src/services/concurrency.js - Pending Write Log → MySQL Pools: stores log entries
backend/src/services/recovery.js - Distributed Writes → Three MySQL Nodes: writes replicas
backend/src/services/replication.js