How srilakshmikanthanp/replica works
Replica is a Java database-replication library, with a runnable master/slave playground and web UI. A source-side write is committed with an outbox event; publishers deliver events to destination inboxes, where processing applies them in order with at-least-once delivery. Adding a station also schedules backfill of existing data. The graph includes the documented event, station, and backfill capabilities plus the playground’s domain-write path. Some core internals and UI/API wiring were not sampled, so those links rely on README statements or are omitted.
Main entry points: outbox Transactional outbox · inbox Inbox processing · spring Spring JPA adapters · ProductWriteController.java Product writes
Components 21
Replication core
- Transactional outbox
replica-core/src/main/java/com/srilakshmikanthanp/replica/outbox - Outbox publisher
replica-core/src/main/java/com/srilakshmikanthanp/replica/outbox - Inbox processing
replica-core/src/main/java/com/srilakshmikanthanp/replica/inbox - Event registry and handlers
replica-core/src/main/java/com/srilakshmikanthanp/replica/event - Backfill jobs
replica-core/src/main/java/com/srilakshmikanthanp/replica/outbox/backfill - Payload cryptography
replica-core/src/main/java/com/srilakshmikanthanp/replica/crypto/PayloadCryptography.java - Transaction coordination
replica-core/src/main/java/com/srilakshmikanthanp/replica/database/transaction/TransactionExecutor.java
Playground API
- Product writes
replica-playground-api/src/main/java/com/srilakshmikanthanp/replica/playground/product/controller/ProductWriteController.java - Product data
replica-playground-api/src/main/java/com/srilakshmikanthanp/replica/playground/product - Replication-aware writes
replica-playground-api/src/main/java/com/srilakshmikanthanp/replica/playground/product/replication - Replication transport
replica-playground-api/src/main/java/com/srilakshmikanthanp/replica/playground/replication/wire - Inbox receiver
replica-playground-api/src/main/java/com/srilakshmikanthanp/replica/playground/replication/inbox/ReceiveController.java - Station management
replica-playground-api/src/main/java/com/srilakshmikanthanp/replica/playground/replication/station/StationService.java - Category replication
replica-playground-api/src/main/java/com/srilakshmikanthanp/replica/playground/category/replication - Tag replication
replica-playground-api/src/main/java/com/srilakshmikanthanp/replica/playground/tag/replication - Inbox/outbox views
replica-playground-api/src/main/java/com/srilakshmikanthanp/replica/playground/replication - Playground master and slaves
replica-playground-api/src/main/java/com/srilakshmikanthanp/replica/playground/replication
Playground web
- Playground UI
replica-playground-web/src - Web API client
replica-playground-web/src/api
Persistence adapters
- Spring JPA adapters
replica-spring-jpa/src/main/java/com/srilakshmikanthanp/replica/spring
Other components
- Operator
Connections 20
- Operator → Playground UI: operates
README.md - Playground UI → Web API client: requests data
- Web API client → Product writes: calls API
- Product writes → Product data: reads data
replica-playground-api/src/main/java/com/srilakshmikanthanp/replica/playground/product/controller/ProductWriteController.java - Product writes → Replication-aware writes: writes through
replica-playground-api/src/main/java/com/srilakshmikanthanp/replica/playground/product/controller/ProductWriteController.java - Replication-aware writes → Transactional outbox: records events
- Outbox publisher → Replication transport: sends batches
- Replication transport → Inbox receiver: delivers batch
replica-playground-api/src/main/java/com/srilakshmikanthanp/replica/playground/replication/inbox/ReceiveController.java - Inbox receiver → Inbox processing: stores messages
replica-playground-api/src/main/java/com/srilakshmikanthanp/replica/playground/replication/inbox/ReceiveController.java - Inbox processing → Event registry and handlers: dispatches events
- Station management → Backfill jobs: creates job
replica-playground-api/src/main/java/com/srilakshmikanthanp/replica/playground/replication/station/StationService.java - Station management → Playground master and slaves: registers peer
replica-playground-api/src/main/java/com/srilakshmikanthanp/replica/playground/replication/station/StationService.java - Backfill jobs → Transactional outbox: backfills data
replica-core/src/main/java/com/srilakshmikanthanp/replica/outbox/backfill/BackfillJobService.java - Spring JPA adapters → Transactional outbox: persists outbox
replica-spring-jpa/src/main/java/com/srilakshmikanthanp/replica/spring/outbox/OutboxSpringRepository.java - Spring JPA adapters → Inbox processing: persists inbox
replica-spring-jpa/src/main/java/com/srilakshmikanthanp/replica/spring/inbox/InboxSpringRepository.java - Spring JPA adapters → Station management: persists stations
- Category replication → Transactional outbox: emits changes
- Tag replication → Transactional outbox: emits changes
- Inbox/outbox views → Playground UI: exposes status
- Transactional outbox → Inbox processing: delivers at least once
README.md