Lab 3: Nginx balancing and API failover #1

Merged
dizi merged 5 commits from solution/bvt2303-plastinin into main 2026-10-02 17:42:41 +03:00
Owner

Summary

  • Nginx round-robin entry point for 2+ stateless API replicas with Docker DNS discovery
  • shared PostgreSQL idempotency and Valkey sessions across replicas
  • separate migration job, graceful shutdown, failover and rolling update scripts
  • Prometheus/Grafana monitoring for API replicas, Nginx, PostgreSQL and Valkey
  • Gitea CI plus manually approved exact-SHA deployment workflow

Verification

  • make check
  • go test ./...
  • go build ./cmd/...
  • public smoke and PostgreSQL/Valkey integration checks
  • persistence after restarting API and both stores
  • two API failover runs with recovery in 1.35–1.44 seconds
  • rolling update under 60 seconds of Go load: 134894 successful requests, 0 errors

Grade 5 track

Track 1 compares 1/2/4 replicas under fixed and growing resource budgets across 60 measured points. Raw data, median aggregates, the RPS chart, pool tuning result and limitations are documented in REPORT.md and evidence/.

## Summary - Nginx round-robin entry point for 2+ stateless API replicas with Docker DNS discovery - shared PostgreSQL idempotency and Valkey sessions across replicas - separate migration job, graceful shutdown, failover and rolling update scripts - Prometheus/Grafana monitoring for API replicas, Nginx, PostgreSQL and Valkey - Gitea CI plus manually approved exact-SHA deployment workflow ## Verification - `make check` - `go test ./...` - `go build ./cmd/...` - public smoke and PostgreSQL/Valkey integration checks - persistence after restarting API and both stores - two API failover runs with recovery in 1.35–1.44 seconds - rolling update under 60 seconds of Go load: 134894 successful requests, 0 errors ## Grade 5 track Track 1 compares 1/2/4 replicas under fixed and growing resource budgets across 60 measured points. Raw data, median aggregates, the RPS chart, pool tuning result and limitations are documented in `REPORT.md` and `evidence/`.
dizi closed this pull request 2026-10-02 14:43:19 +03:00
dizi reopened this pull request 2026-10-02 14:43:22 +03:00
dizi force-pushed solution/bvt2303-plastinin from 92e3d58548 to ff810a44c1 2026-10-02 14:45:14 +03:00 Compare
dizi force-pushed solution/bvt2303-plastinin from ff810a44c1 to 0297f4d8c0 2026-10-02 14:46:55 +03:00 Compare
dizi force-pushed solution/bvt2303-plastinin from 0297f4d8c0 to 7623187e1a 2026-10-02 14:50:26 +03:00 Compare
dizi added 1 commit 2026-10-02 16:00:23 +03:00
dizi force-pushed solution/bvt2303-plastinin from 7623187e1a to 7cdb7ce0bf 2026-10-02 16:00:23 +03:00 Compare
dizi added 3 commits 2026-10-02 16:01:36 +03:00
dizi force-pushed solution/bvt2303-plastinin from 7cdb7ce0bf to 18d51db435 2026-10-02 16:01:36 +03:00 Compare
dizi added 1 commit 2026-10-02 17:24:12 +03:00
fix: address review comments
CI / verify (pull_request) Successful in 4m21s
0062313c0b
dizi marked the pull request as ready for review 2026-10-02 17:42:37 +03:00
dizi merged commit 293402cb3d into main 2026-10-02 17:42:41 +03:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dizi/mtusi2026lab3#1