LiveOps Event Join API is a high-performance, concurrency-safe backend service designed to handle player join requests for online events. The service ensures correct group assignment, prevents race conditions, supports horizontal scaling, and provides robust error handling with retry mechanisms.
Backend: Go + PostgreSQL
- Submit join requests for events with player details.
- Assign players to groups based on level category (bronze, silver, gold).
- Concurrency-safe handling to prevent duplicate enrollments.
- Retry mechanism for transient database errors.
- Graceful handling of database outages.
- Full testing support (unit tests, integration tests, concurrent join tests).
- Dockerized application for easy deployment.
- Machine-readable API specification via OpenAPI v3.
- Programming Language: Go 1.23
- Web Framework: Fiber v2
- Database: PostgreSQL 15
- API Specification: OpenAPI v3 (
liveops_api.yaml) - Containerization: Docker, Docker Compose
- Testing: Go unit tests, integration tests, concurrency tests
- Build & Automation: Makefile for building, testing, and managing environments
- Protocols: HTTP/REST, JSON for request/response payloads
To run in production mode using Docker Compose:
docker compose up --buildApplication will run on: localhost:3000
PostgreSQL will be available on: localhost:5432
make build
then
make upApplication will run on: localhost:3001
PostgreSQL will be available on: localhost:5433
make down -> Stop the container
make test -> Run testsIn case Make is not installed, use docker compose -f docker-compose.test.yml up --build
POST /v1/events/{event_id}/join Content-Type: application/json Body: { "playerId": "player10", "level": 27 }
curl -X POST http://localhost:3000/v1/events/1/join
-H "Content-Type: application/json"
-d '{
"playerId": "player7",
"level": "51"
}'