Back to projects

Movix

Event-Driven Video Streaming Backend Built with Spring Boot Microservices, Apache Kafka, and CQRS.

springboot

Spring Boot

graphql

GraphQL

elasticsearch

elastic search

docker

Docker

apachekafka

Kafka

postgresql

Postgres

apachecassandra

Cassandra

Movix project

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-architecture.svg

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

ServiceStore / InterfaceResponsibility
auth-svcIdentity / JWTAuthentication and access control
cms-svcPostgreSQL (Outbox)Content and collection management, publishing lifecycle
transcoder-svcMinIO (S3)Asynchronous media transcoding pipeline
ctg-svcCassandra & ElasticsearchCatalog read-model projection and search index synchronization
gql-svcGraphQLUnified discovery API querying Cassandra and Elasticsearch

Key Engineering Decisions

  • Dual-Write Prevention (Transactional Outbox): cms-svc writes 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

  1. Authoring: A moderator creates a media entry or curated collection in cms-svc.
  2. Asset Upload: Raw media files are uploaded directly to MinIO object storage.
  3. Atomic Publish: Publishing updates the content status in PostgreSQL and appends an event to the transactional outbox table.
  4. Event Fan-Out: Events are relayed to Apache Kafka topics consumed by downstream workers.
  5. Transcoding & Hydration: transcoder-svc processes the media assets in MinIO, while ctg-svc updates materialized views in Cassandra and indexes metadata in Elasticsearch.
  6. Discovery: Clients query gql-svc to 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.