OrionScheduler is a single-node, crash-consistent DAG scheduler written in Go with a Next.js observability console.
It is intentionally not a distributed scheduler. The core design choice is a centralized scheduler because deterministic recovery, correctness, and interview explainability matter more here than premature multi-node coordination.
- DAG validation with duplicate-ID, unknown-dependency, and cycle rejection.
- Kahn-style scheduling with dependency-aware task release.
- Priority queue based dispatch into a concurrent worker pool.
- fsync-backed write-ahead log for crash-consistent recovery.
- Retry handling for task failures and cascade failure for downstream dependents.
- Crash/recover simulation where the HTTP process stays alive while the scheduler and workers restart from WAL replay.
- Real-time UI that shows task flow, worker state, event stream, and derived system internals.
The fastest way to understand the system is:
- Open the console.
- Run the auto-demo.
- Watch a DAG enter the scheduler, workers execute tasks, the scheduler crash, and recovery replay the WAL.
- Switch to manual mode and submit smaller DAGs, failure-heavy DAGs, or priority-heavy DAGs.
The project is designed to support this interview answer:
I kept scheduling centralized because deterministic replay and correctness were the goal. The scheduler owns DAG state, workers only execute tasks, and the WAL is the source of recovery truth. That keeps failure handling explainable while still demonstrating concurrency, backpressure, retry, cascade failure, and crash recovery.
flowchart LR
UI["Next.js observability console"]
API["Go REST + WebSocket API"]
S["Centralized scheduler"]
PQ["Priority queue"]
W["Worker pool"]
WAL["fsync WAL"]
UI -->|"submit DAG / admin actions"| API
API -->|"validated tasks"| WAL
API -->|"ingest"| S
S --> PQ
PQ --> W
W -->|"start/complete/fail"| WAL
W -->|"result events"| S
S -->|"events + snapshots"| API
API -->|"WebSocket / REST"| UI
- Crash recovery is based on local WAL replay, not replicated consensus.
- Scheduling is centralized to avoid split-brain and leader-election complexity.
- The system demonstrates at-least-once execution semantics, not exactly-once execution.
- The UI distinguishes backend-reported state from event-derived views.
- Admin crash/recover endpoints are demo controls and should be protected in public deployments.
go run ./cmd/serverThe backend defaults to http://localhost:8080.
Useful environment variables:
PORT: backend port.WAL_PATH: WAL file path. Use a throwaway path for demos and tests.WORKER_COUNT: number of execution workers.CORS_ORIGIN: exact frontend origin for public deployments.WS_ORIGIN: exact WebSocket origin for public deployments.ADMIN_TOKEN: optional demo token required for crash/recover endpoints.
cd frontend
npm ci
npm run devFrontend environment variables:
NEXT_PUBLIC_API_URL: deployed backend URL, for examplehttps://orion-scheduler-api.onrender.com.NEXT_PUBLIC_WS_URL: deployed WebSocket URL, for examplewss://orion-scheduler-api.onrender.com/ws.NEXT_PUBLIC_ADMIN_TOKEN: demo token sent by the console to crash/recover endpoints. This is public once bundled; it is demo integrity protection, not real auth.
Backend deployment target: Render web service.
- Runtime: Go.
- Build command:
go build -tags netgo -ldflags '-s -w' -o app ./cmd/server. - Start command:
./app. - Health check path:
/readyz. - The server binds to Render's
PORTenvironment variable. - Free tier is acceptable for one public demo, but the filesystem is ephemeral. WAL replay works for the in-process crash/recover demo; WAL state is not guaranteed across Render restarts, redeploys, or spin-downs.
- Set exact
CORS_ORIGINandWS_ORIGINtohttps://orion.hrushikeshramilla.in. - Set
ADMIN_TOKENbefore sharing a public demo. This is demo integrity protection, not an auth system.
Frontend deployment target: Vercel.
- Use
npm cifor deterministic installs. - Set
NEXT_PUBLIC_API_URLandNEXT_PUBLIC_WS_URL; do not rely on localhost fallbacks in production. - For one public recruiter demo, set
NEXT_PUBLIC_ADMIN_TOKENto match the RenderADMIN_TOKENso auto-demo crash/recovery works from the public URL. - Add the production custom domain
orion.hrushikeshramilla.inin the Vercel project.
go test ./...
cd frontend && npm run lint && npm run buildOrionScheduler is not Raft, not Kubernetes, not a Kafka replacement, and not a multi-node distributed scheduler. It is a deliberately scoped, deeply engineered single-node orchestration system optimized for crash recovery, correctness, observability, and interview explainability.