Movix
Event-Driven Video Streaming Backend Built with Spring Boot Microservices, Apache Kafka, and CQRS.
Spring Boot
GraphQL
elastic search
Docker
Kafka
Postgres
Cassandra
Movix
A distributed, Netflix-inspired media streaming backend built with Java and Spring Boot microservices.
Movix is engineered around Command Query Responsibility Segregation (CQRS) to separate write-heavy content authoring and video transcoding from high-throughput catalog discovery. Independent services communicate asynchronously over Apache Kafka using the Transactional Outbox pattern, backed by polyglot persistence across PostgreSQL, Cassandra, Elasticsearch, and MinIO.
Technology Stack
- Core & API: Java, Spring Boot, GraphQL
- Event Streaming: Apache Kafka (Transactional Outbox Pattern)
- Storage & Search: PostgreSQL, Apache Cassandra, Elasticsearch, MinIO
- Infrastructure & Observability: Docker, Grafana, Kibana, Kafka UI
Architecture
Movix isolates content creation from content consumption. Moderators author and publish media through cms-svc, which records state transitions and outbox events atomically. Downstream consumers independently transcode raw media assets and hydrate denormalized read models, allowing gql-svc to serve discovery queries with minimal latency.
Microservices Breakdown
| Service | Store / Interface | Responsibility |
|---|---|---|
auth-svc | Identity / JWT | Authentication and access control |
cms-svc | PostgreSQL (Outbox) | Content and collection management, publishing lifecycle |
transcoder-svc | MinIO (S3) | Asynchronous media transcoding pipeline |
ctg-svc | Cassandra & Elasticsearch | Catalog read-model projection and search index synchronization |
gql-svc | GraphQL | Unified discovery API querying Cassandra and Elasticsearch |
Key Engineering Decisions
- Dual-Write Prevention (Transactional Outbox):
cms-svcwrites domain mutations and outbox events within the same PostgreSQL transaction, guaranteeing at-least-once event propagation to Kafka even during broker interruptions. - Polyglot Persistence: Matches each workload to its optimal storage engine—relational ACID guarantees in PostgreSQL for authoring, wide-column read scalability in Cassandra for catalog views, inverted indexing in Elasticsearch for search, and object storage in MinIO for media binaries.
- Decoupled Media Processing: Offloading transcoding to an event-driven worker (
transcoder-svc) keeps CMS publishing responsive while scaling compute-heavy media jobs independently.
End-to-End Publishing Workflow
- Authoring: A moderator creates a media entry or curated collection in
cms-svc. - Asset Upload: Raw media files are uploaded directly to MinIO object storage.
- Atomic Publish: Publishing updates the content status in PostgreSQL and appends an event to the transactional outbox table.
- Event Fan-Out: Events are relayed to Apache Kafka topics consumed by downstream workers.
- Transcoding & Hydration:
transcoder-svcprocesses the media assets in MinIO, whilectg-svcupdates materialized views in Cassandra and indexes metadata in Elasticsearch. - Discovery: Clients query
gql-svcto browse collections, search titles, and stream processed media.
Local Development & Tooling
The local Docker environment bundles Kafka UI, Kibana, Grafana, and the MinIO Console alongside core datastores for inspecting event streams, debugging Elasticsearch indices, and monitoring service health.