Back to Blog

Netflix Hollow End-to-End Demo: Complete Implementation Guide

A comprehensive guide to implementing Netflix Hollow for efficient data distribution across microservices. Learn how to build a production-ready system with monitoring, containerization, and performance optimization.

September 10, 2025
25 min read
SyntheBrain Team

Complete Source Code

Get the full implementation with all configurations and examples

πŸ”— GitHub Repository

https://github.com/fxellence-dev/rawhollow-demo

View on GitHub
Complete Docker setup
Production configurations
Monitoring & observability

Overview

This project demonstrates a complete end-to-end implementation of Netflix Hollow - a Java library for disseminating in-memory datasets. The demo showcases a real-world scenario where a movie catalog service publishes data that multiple consumer services can efficiently read without database queries.

Key Features

  • Producer Service: Publishes movie catalog data using Hollow
  • Consumer Service: Reads and queries movie data with high performance
  • Complete Monitoring: Prometheus metrics and Grafana dashboards
  • Containerized Deployment: Docker Compose for easy setup
  • Performance Testing: Load testing scripts included
  • Production-Ready: Comprehensive logging, error handling, and monitoring

Performance Metrics

Query Latency:< 1ms
Publication Time:< 10s
Update Propagation:< 60s
Memory per Consumer:< 500MB
Concurrent Consumers:1000+

What is Netflix Hollow?

Netflix Hollow is an open-source Java library designed for efficiently disseminating large, read-heavy datasets from a single producer to many consumers. It was created at Netflix to solve the problem of distributing reference data (like movie catalogs, user preferences, configuration data) to thousands of microservices.

Core Concepts

Publisher/Consumer Pattern:

One service publishes data, many services consume it

Snapshot + Delta Updates:

Efficient incremental updates

In-Memory Performance:

Data is loaded into memory for ultra-fast access

Type-Safe Access:

Generated code provides compile-time safety

Blob Storage:

Uses pluggable blob stores (filesystem, S3, etc.)

Key Benefits

  • Performance: Sub-millisecond data access after loading
  • Scalability: Supports thousands of consumers
  • Efficiency: Delta updates minimize bandwidth usage
  • Consistency: All consumers eventually see the same data
  • Reliability: Built-in versioning and rollback capabilities

Problem Statement & Why Hollow?

The Challenge

Modern microservices architectures often face the challenge of sharing reference data efficiently:

  • Database Bottlenecks: Multiple services querying the same reference tables creates hotspots
  • Network Latency: Remote database calls add latency to every request
  • Consistency Issues: Cache invalidation across services is complex
  • Operational Overhead: Managing database connections and query optimization

Traditional Solutions & Their Limitations

ApproachProsCons
Shared DatabaseSimple, consistentBottleneck, coupling, latency
REST APIsDecoupledNetwork calls, latency, availability
Message QueuesAsync, decoupledComplex state management
Distributed CacheFast accessCache invalidation complexity

Why Netflix Hollow?

Hollow solves these problems by:

  • Eliminating Database Queries: Data is pre-loaded in memory
  • Reducing Network Calls: Local in-memory access only
  • Ensuring Consistency: All consumers get the same versioned data
  • Minimizing Operational Overhead: Simple blob-based distribution
  • Providing Performance: Sub-millisecond query times

Quick Start Guide

Get the Netflix Hollow demo running in under 5 minutes:

# Clone and start the complete stack
git clone https://github.com/fxellence-dev/rawhollow-demo.git
cd rawhollow-demo
./start-docker.sh
# Access services
Producer: http://localhost:8080
Consumer: http://localhost:8081
Grafana: http://localhost:3000 (admin/hollow123)
View on GitHub

Use Case & Architecture

Business Scenario

Our demo implements a Movie Catalog Distribution System where:

  • A central service maintains a catalog of movies with ratings and genres
  • Multiple consumer services need fast access to this data for recommendations, search, etc.
  • Data changes periodically but needs to be distributed efficiently
  • High read performance is critical for user-facing services

System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Producer      β”‚    β”‚   Blob Storage   β”‚    β”‚   Consumer      β”‚
β”‚   Service       │───▢│   (Filesystem)   │◄───│   Services      β”‚
β”‚                 β”‚    β”‚                  β”‚    β”‚                 β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚    β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚    β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚Movie Catalogβ”‚ β”‚    β”‚ β”‚ Snapshots    β”‚ β”‚    β”‚ β”‚Movie Queriesβ”‚ β”‚
β”‚ β”‚Management   β”‚ β”‚    β”‚ β”‚ + Deltas     β”‚ β”‚    β”‚ β”‚& Analytics  β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚    β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚    β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                       β”‚                       β”‚
         β”‚                       β”‚                       β”‚
         β–Ό                       β–Ό                       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Prometheus    β”‚    β”‚    Grafana       β”‚    β”‚   Load Testing  β”‚
β”‚   Metrics       β”‚    β”‚   Dashboards     β”‚    β”‚   Scripts       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Producer Service

Port: 8080

Technology: Spring Boot 3.1.0 + Netflix Hollow 7.0.2

Responsibilities:

  • β€’ CRUD operations on movie data
  • β€’ Publishing snapshots and deltas
  • β€’ Exposing management endpoints
  • β€’ Metrics collection

Consumer Service

Port: 8081

Technology: Spring Boot 3.1.0 + Hollow Consumer

Responsibilities:

  • β€’ Loading and updating datasets
  • β€’ Providing fast query endpoints
  • β€’ Performance monitoring
  • β€’ Data validation

Monitoring Stack

Prometheus: Metrics collection

Grafana: Visualization and alerting

Features:

  • β€’ Custom business metrics
  • β€’ Technical KPIs
  • β€’ Real-time dashboards
  • β€’ Alert management

Data Flow

1. Initial Publication

Producer β†’ Generate Snapshot β†’ Store in Blob β†’ Announce Version

2. Incremental Updates

Producer β†’ Generate Delta β†’ Store in Blob β†’ Announce New Version

3. Consumer Updates

Consumer β†’ Check Version β†’ Download Delta β†’ Apply Changes β†’ Update Queries

Implementation Details

Data Model

Our movie catalog consists of three main entity types:

Movie Entity

// Movie entity with comprehensive attributes
public class Movie {
    private int id;
    private String title;
    private String genre;
    private double rating;
    private int releaseYear;
    private String director;
    private String description;
}

Genre Reference Data

// Genre reference data
public class Genre {
    private int id;
    private String name;
    private String description;
}

Rating Aggregation

// Rating aggregation data
public class Rating {
    private int movieId;
    private double averageRating;
    private int reviewCount;
    private double imdbRating;
}

Hollow Schema Definition

The Hollow schema defines how data is serialized and versioned:

@HollowPrimaryKey(fields="id")
public class Movie {
    int id;
    String title;
    String genre;
    double rating;
    int releaseYear;
    String director;
    String description;
}

@HollowPrimaryKey(fields="id") 
public class Genre {
    int id;
    String name;
    String description;
}

@HollowPrimaryKey(fields="movieId")
public class Rating {
    int movieId;
    double averageRating;
    int reviewCount;
    double imdbRating;
}

Producer Implementation

Core Configuration

@Configuration
public class HollowConfig {
    @Bean
    public HollowProducer hollowProducer() {
        return HollowProducer.withPublisher(blobPublisher())
                .withBlobStager(new HollowFilesystemBlobStager(
                    Paths.get("/app/shared-data")))
                .withListener(new ProducerMetricsListener())
                .withNumStatesBetweenSnapshots(10)
                .build();
    }
}

Key Features

  • β€’ Batch Operations: Efficient bulk data publishing
  • β€’ Error Handling: Comprehensive exception management
  • β€’ Monitoring: Detailed metrics on publishing performance
  • β€’ Validation: Data integrity checks before publishing

Consumer Implementation

Configuration & Setup

@Configuration
public class HollowConsumerConfig {
    @Bean
    public HollowConsumer hollowConsumer() {
        return HollowConsumer.withBlobRetriever(blobRetriever())
                .withListener(new ConsumerMetricsListener())
                .withRefreshIntervalMs(30000)
                .build();
    }
}

Query Patterns

  • β€’ Single Record Lookup: Fast ID-based retrieval
  • β€’ Index Queries: Genre-based filtering
  • β€’ Complex Queries: Multi-criteria searches
  • β€’ Aggregations: Runtime calculations on datasets

Configuration & Setup

Prerequisites

  • Docker: Version 20.0+ with Docker Compose
  • Java: JDK 17+ (for local development)
  • Maven: 3.8+ (for local builds)
  • Memory: At least 4GB RAM for all services
  • Disk: 1GB+ free space for data and logs

Environment Configuration

Docker Environment Variables

# Producer Service
SPRING_PROFILES_ACTIVE: docker
HOLLOW_BLOB_PATH: /app/shared-data
SERVER_PORT: 8080

# Consumer Service  
SPRING_PROFILES_ACTIVE: docker
HOLLOW_BLOB_PATH: /app/shared-data
SERVER_PORT: 8081

# Monitoring
PROMETHEUS_RETENTION: 15d
GRAFANA_ADMIN_PASSWORD: hollow123

Application Properties

# Producer application-docker.properties
management.endpoints.web.exposure.include=*
management.endpoint.health.show-details=always
management.metrics.export.prometheus.enabled=true

# Consumer application-docker.properties
hollow.consumer.refresh-interval-ms=30000
hollow.consumer.max-concurrent-updates=3
management.metrics.export.prometheus.enabled=true

Network Configuration

  • Producer Service: http://localhost:8080
  • Consumer Service: http://localhost:8081
  • Prometheus: http://localhost:9090
  • Grafana: http://localhost:3000

Security Configuration

  • Grafana Credentials: admin / hollow123
  • Actuator Endpoints: Enabled for monitoring
  • CORS: Configured for development use

Running the Application

Quick Start (Recommended)

# Clone and navigate to project
git clone <repository-url>
cd RAWHollow

# Start all services
./start-docker.sh

# Wait for services to be ready (about 2-3 minutes)
# Check status
docker-compose ps
Services take 2-3 minutes to fully initialize

Step-by-Step Startup

1Build Services

# Build all Docker images
./build-all.sh

# Or build individually
cd producer-service && mvn clean package
cd ../consumer-service && mvn clean package

2Start Infrastructure

# Start with dependency ordering
docker-compose up -d prometheus grafana

# Wait for monitoring to be ready
sleep 30

3Start Application Services

# Start producer first
docker-compose up -d producer-service

# Wait for producer to be ready
sleep 60

# Start consumer
docker-compose up -d consumer-service

4Verify Startup

# Check all services are running
docker-compose ps

# Verify health endpoints
curl http://localhost:8080/actuator/health
curl http://localhost:8081/actuator/health

Alternative: Local Development

Running Producer Locally

cd producer-service
mvn spring-boot:run \
  -Dspring-boot.run.profiles=local

Running Consumer Locally

cd consumer-service
mvn spring-boot:run \
  -Dspring-boot.run.profiles=local
Note: Local development requires setting up shared storage paths manually.

Testing & Validation

Automated Testing Suite

The demo includes comprehensive testing covering unit tests, integration tests, and end-to-end validation.

Unit Tests
# Run unit tests
mvn test

# Run specific test class
mvn test -Dtest=HollowDataModelTest

# Generate coverage report
mvn jacoco:report
Integration Tests
# Run integration tests
mvn verify -P integration-tests

# Test data consistency
curl -X GET \
  http://localhost:8080/api/validate/consistency

# Test producer-consumer flow
curl -X POST \
  http://localhost:8080/api/test/end-to-end

Load Testing

Validate performance under various load conditions to ensure production readiness.

# JMeter load test
jmeter -n -t src/test/jmeter/hollow-load-test.jmx -l results.jtl

# Artillery.js quick load test
artillery quick --count 100 --num 10 http://localhost:8080/api/products

# Custom load test script
./scripts/load-test.sh --concurrent-users 50 --duration 300s

Manual Testing Scenarios

Data Consistency
  • β€’ Verify data updates across all consumers
  • β€’ Test snapshot consistency
  • β€’ Validate incremental updates
Performance
  • β€’ Memory usage optimization
  • β€’ Query response times
  • β€’ Concurrent access patterns

Monitoring & Observability

Grafana Dashboards

Pre-configured Grafana dashboards provide real-time insights into Hollow performance and system health.

System Metrics
  • β€’ Memory usage patterns
  • β€’ CPU utilization
  • β€’ Disk I/O statistics
  • β€’ Network throughput
Hollow Metrics
  • β€’ Snapshot update frequency
  • β€’ Data refresh latency
  • β€’ Consumer query performance
  • β€’ Cache hit rates
Access Dashboards
# Grafana Dashboard URLs
http://localhost:3000/d/hollow-overview
http://localhost:3000/d/hollow-performance
http://localhost:3000/d/hollow-health

# Default credentials
Username: admin
Password: admin

Key Performance Indicators

< 10ms
Average Query Time
99.9%
Data Consistency
< 500MB
Memory Footprint

Alerting Configuration

Configure alerts for critical system events and performance thresholds.

# Alert Rules (Prometheus)
groups:
  - name: hollow.rules
    rules:
      - alert: HighMemoryUsage
        expr: hollow_memory_usage > 0.8
        for: 5m
        labels:
          severity: warning
        annotations:
          summary: "High memory usage detected"
          
      - alert: SlowQueryResponse
        expr: hollow_query_duration_seconds > 0.1
        for: 2m
        labels:
          severity: critical

API Documentation

Core Endpoints

GET/api/products

Retrieve all products from Hollow dataset

GET/api/products/{id}

Get specific product by ID

GET/api/categories

List all product categories

GET/api/health

System health check and status

Example API Responses

Product Response
{
  "id": 1,
  "name": "Premium Laptop",
  "description": "High-performance laptop for professionals",
  "price": 1299.99,
  "category": {
    "id": 1,
    "name": "Electronics"
  },
  "inStock": true,
  "lastUpdated": "2025-09-10T10:30:00Z"
}
Health Check Response
{
  "status": "UP",
  "timestamp": "2025-09-10T10:30:00Z",
  "hollow": {
    "dataVersion": "v1.2.3",
    "lastUpdate": "2025-09-10T10:25:00Z",
    "recordCount": 150000,
    "memoryUsage": "245MB"
  },
  "database": {
    "status": "UP",
    "connectionPool": "8/10 active"
  }
}

Admin Endpoints

Authentication Required

Admin endpoints require API key authentication

POST /api/admin/refreshTrigger data refresh
GET /api/admin/metricsSystem metrics
POST /api/admin/cache/clearClear cache

Troubleshooting Guide

Common Issues & Solutions

Application fails to start

Symptoms: Spring Boot application throws exceptions during startup

Solutions:

  • β€’ Check database connectivity: docker ps
  • β€’ Verify environment variables are set correctly
  • β€’ Ensure ports 8080, 5432, 3000, 9090 are available
  • β€’ Run docker-compose down && docker-compose up --build
High memory usage

Symptoms: Application consumes excessive memory, OutOfMemoryError

Solutions:

  • β€’ Adjust JVM heap size: -Xmx2g -Xms1g
  • β€’ Optimize Hollow data model size
  • β€’ Enable JVM garbage collection tuning
  • β€’ Monitor via /api/admin/metrics
Slow query performance

Symptoms: API responses taking longer than expected

Solutions:

  • β€’ Check if data refresh is in progress
  • β€’ Verify index configuration in Hollow schema
  • β€’ Monitor CPU usage during queries
  • β€’ Consider query optimization patterns

Debugging Commands

# Check application logs
docker-compose logs -f hollow-demo

# Monitor system resources
docker stats

# Check database connectivity
docker exec -it postgres_db psql -U hollow_user -d hollow_db

# Verify Hollow data integrity
curl -X GET http://localhost:8080/api/admin/validate

# Debug memory usage
jmap -histo <java_process_id>

# Profile application performance
java -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -jar app.jar

Getting Help

Documentation
  • β€’ Netflix Hollow GitHub
  • β€’ Official Documentation
  • β€’ API Reference
Community
  • β€’ Stack Overflow: netflix-hollow
  • β€’ GitHub Issues
  • β€’ Discord Community

Conclusion

This comprehensive Netflix Hollow end-to-end demo showcases the power of in-memory data management for high-performance applications. By following this guide, you've learned how to:

  • Set up a complete Hollow-based system with producer and consumer components
  • Implement efficient data models and schemas for optimal performance
  • Deploy and monitor the system with comprehensive observability tools
  • Troubleshoot common issues and optimize system performance

Netflix Hollow provides a powerful foundation for building scalable, high-performance data systems. This demo serves as a starting point for implementing Hollow in your production environments.

Complete source code available on GitHub:

https://github.com/fxellence-dev/rawhollow-demo
View Code