How aarthikrao/timemachine works
Project Type and Purpose
• Type: A distributed, fault-tolerant scheduler database (no user-facing UI, but a cluster of server nodes plus CLI).
• Purpose: Store, route, and execute millions of scheduled jobs across a cluster, using consensus (Raft) for consistency, DHT for load balancing, and B+Tree (BoltDB) for local storage.
File Structure
• cmd/cli: Command-line client to interact with the cluster.
• cmd/server: Main server entrypoint, sets up routes and “timeMachine” node.
• components/: Core pluggable modules (consensus, datashard, dht, executor, jobstore, network, routestore).
• handlers/rest: HTTP/REST API layer (cluster, job, route endpoints).
• models/: Protobuf and Go structs for config, jobs, routes.
• process/: Internal controllers (cluster health, connection manager, coordinator, datastore manager, node manager, publisher).
• scripts/: Shell scripts to build, spawn, join, configure cluster nodes.
• utils/: Shared helpers (address, constants, HTTP/gRPC clients, time).
README for Additional Insights
• Tech stack callouts: BBoltDB, Raft, DHT, gRPC.
• Workflow: scripts create local folders, spawn multiple instances, nodes join to form a cluster, configure slot distribution, monitor status.
• Documentation links to deeper architecture and component details under docs/ and components/.