# dockersamples/example-voting-app

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/dockersamples-example-voting-app).**

5,622 stars · 15,105 forks · C# · apache-2.0

## Links

- GitHub: https://github.com/dockersamples/example-voting-app
- awesome-repositories: https://awesome-repositories.com/repository/dockersamples-example-voting-app.md

## Topics

`demo` `docker` `docker-compose` `example` `kubernetes` `sample` `swarm`

## Description

This is a distributed voting application designed to demonstrate a multi-service architecture. It uses stateless web frontends for submitting votes and viewing live results, with a Redis-backed queue to buffer incoming votes and a PostgreSQL database for persistent tallying. The application is built around asynchronous message queue processing, decoupling the vote submission from the tallying workflow.

The project showcases how to deploy a multi-service application using container orchestration tools. It provides YAML-driven declarative deployment manifests for Docker Compose, Docker Swarm, and Kubernetes, enabling reproducible deployments across single hosts or clusters. A background worker service reads votes from the message queue and writes them to the database for reliable, real-time result aggregation.

The application includes a voting ballot interface for user input and a live results viewer that displays aggregated vote counts as they are processed. The entire system is defined as interconnected Docker containers, with services, networks, and volumes specified in YAML manifests for flexible deployment.

## Tags

### Software Engineering & Architecture

- [Distributed Polling Systems](https://awesome-repositories.com/f/software-engineering-architecture/voting-mechanisms/distributed-polling-systems.md) — Runs a distributed voting system with multiple services, queues, and databases to collect and tally votes.
- [Redis-Backed Queues](https://awesome-repositories.com/f/software-engineering-architecture/distributed-task-queues/redis-backed-queues.md) — Stores incoming ballot choices in a Redis list for asynchronous processing by a background worker.
- [Vote Buffers](https://awesome-repositories.com/f/software-engineering-architecture/distributed-task-queues/redis-backed-queues/vote-buffers.md) — Buffers incoming votes in a Redis list for reliable asynchronous processing by a background worker.
- [Vote Tallies](https://awesome-repositories.com/f/software-engineering-architecture/job-processors/database-backed-persistence/vote-tallies.md) — Provides a PostgreSQL database that stores processed vote counts for live result aggregation.
- [Live Tally Displays](https://awesome-repositories.com/f/software-engineering-architecture/voting-mechanisms/live-tally-displays.md) — Displays aggregated vote counts as they are processed, updating live through a web interface.
- [PostgreSQL Vote Tallies](https://awesome-repositories.com/f/software-engineering-architecture/voting-mechanisms/postgresql-vote-tallies.md) — Persists processed vote counts in a PostgreSQL database for real-time result aggregation and display.
- [Tally Workers](https://awesome-repositories.com/f/software-engineering-architecture/voting-mechanisms/tally-workers.md) — Runs a background worker that reads votes from a Redis queue and writes them to PostgreSQL. ([source](https://github.com/dockersamples/example-voting-app#readme))
- [Stateless Architectures](https://awesome-repositories.com/f/software-engineering-architecture/stateless-architectures.md) — Ships stateless web frontends that delegate all state management to the message queue and database.

### Data & Databases

- [Live Tally Displays](https://awesome-repositories.com/f/data-databases/query-result-fetching/query-result-visualizers/query-result-viewers/live-tally-displays.md) — Displays aggregated vote counts as they are processed, updating live through a web interface. ([source](https://github.com/dockersamples/example-voting-app/blob/main/README.md))

### DevOps & Infrastructure

- [Docker Compose Deployments](https://awesome-repositories.com/f/devops-infrastructure/container-orchestration/container-runtimes/runtime-configuration-interfaces/docker-socket-orchestrators/docker-target-configurators/docker-container-deployments/docker-compose-deployments.md) — Launches a complete multi-service voting system using a single Docker Compose command.
- [Docker Swarm Orchestration](https://awesome-repositories.com/f/devops-infrastructure/docker-swarm-orchestration.md) — Demonstrates deploying and scaling a multi-service application across a Docker Swarm cluster.
- [Message Queue Workers](https://awesome-repositories.com/f/devops-infrastructure/message-queue-workers.md) — Stores incoming votes in a Redis list for asynchronous consumption by a background worker. ([source](https://github.com/dockersamples/example-voting-app#readme))
- [Message Queues](https://awesome-repositories.com/f/devops-infrastructure/message-queues.md) — Uses a message broker to queue vote messages for background processing, decoupling submission from tallying.
- [Multi-Container Orchestration](https://awesome-repositories.com/f/devops-infrastructure/multi-container-orchestration.md) — Runs as multiple interconnected Docker containers managed by Compose, Swarm, or Kubernetes.
- [Message Queues](https://awesome-repositories.com/f/devops-infrastructure/queue-management/message-queues.md) — Uses a Redis message queue to decouple vote submission from background tallying.
- [Kubernetes Deployments](https://awesome-repositories.com/f/devops-infrastructure/kubernetes-deployments.md) — Deploys the multi-service application to Kubernetes using YAML manifests and node-port services.
- [Multi-Service Manifests](https://awesome-repositories.com/f/devops-infrastructure/kubernetes-deployments/multi-service-manifests.md) — Applies pre-configured YAML manifests to create all Kubernetes services and deployments at once. ([source](https://github.com/dockersamples/example-voting-app/blob/main/README.md))
- [Node-Port Exposures](https://awesome-repositories.com/f/devops-infrastructure/kubernetes-deployments/node-port-exposures.md) — Creates Kubernetes services that expose the voting and result web apps on fixed node ports. ([source](https://github.com/dockersamples/example-voting-app#readme))

### Networking & Communication

- [Queued Vote Persistence Workers](https://awesome-repositories.com/f/networking-communication/message-queuing-systems/queued-vote-persistence-workers.md) — Reads voting messages from a message broker and persists the results to a database for later tallying. ([source](https://github.com/dockersamples/example-voting-app/tree/main/worker))

### Web Development

- [Ballot Forms](https://awesome-repositories.com/f/web-development/backend-to-frontend-bridges/frontend-interfaces/ballot-forms.md) — Presents a web interface where users select between two options and submits the choice to a message queue. ([source](https://github.com/dockersamples/example-voting-app/blob/main/README.md))
- [Background Processing Workers](https://awesome-repositories.com/f/web-development/background-processing-workers.md) — Processes queued tasks asynchronously in a separate service to decouple work from the request-response cycle. ([source](https://github.com/dockersamples/example-voting-app/blob/main/worker))

### Development Tools & Productivity

- [Orchestrator Manifests](https://awesome-repositories.com/f/development-tools-productivity/project-configuration/component-manifest-registration/yaml-component-manifests/orchestrator-manifests.md) — Provides YAML manifests for deploying the application via Docker Compose, Swarm, and Kubernetes.
