🔄 Event Sourcing System

Immutable Event Store with MongoDB - Complete Audit Trail & State Reconstruction

12,547
Total Events
342
Aggregates
24
Event Types
89
Snapshots
284
Events Today
5
Active Projections

📊 Recent Events by Type

Event Type Count (24h) Total Count Last Occurred Aggregate Types
UserCreated 45 2,341 2024-01-20 15:32:18 User
OrderPlaced 128 5,892 2024-01-20 15:30:45 Order
OrderStatusChanged 87 3,247 2024-01-20 15:28:12 Order
PaymentProcessed 92 4,123 2024-01-20 15:25:33 Payment
ProductAdded 23 892 2024-01-20 14:15:20 Inventory

📜 Immutable Event Stream

UserCreated
2024-01-20 15:32:18.234
{ "user_id": "USR-2024-001", "email": "john.doe@example.com", "name": "John Doe", "role": "customer" }
OrderPlaced
2024-01-20 15:30:45.123
{ "order_id": "ORD-2024-5892", "customer_id": "USR-2024-001", "items": [ { "product_id": "PRD-001", "quantity": 2, "price": 29.99 } ], "total_amount": 59.98, "status": "pending" }
OrderStatusChanged
2024-01-20 15:28:12.567
{ "order_id": "ORD-2024-5892", "previous_status": "pending", "new_status": "confirmed", "reason": "Payment verified" }
PaymentProcessed
2024-01-20 15:25:33.891
{ "payment_id": "PAY-2024-4123", "order_id": "ORD-2024-5892", "amount": 59.98, "method": "credit_card", "status": "success", "transaction_id": "TXN-ABC123XYZ" }
ProductAdded
2024-01-20 14:15:20.456
{ "product_id": "PRD-001", "name": "MongoDB Complete Guide", "price": 29.99, "stock": 100, "category": "Books" }
Order Aggregate
ID: ORD-2024-5892
CONFIRMED 📸 Snapshot v2
Customer
USR-2024-001
Total Amount
$59.98
Items Count
1
Event Count
2
Created At
15:30:45
Last Updated
15:28:12
User Aggregate
ID: USR-2024-001
ACTIVE
Name
John Doe
Email
john.doe@example.com
Role
Customer
Event Count
1
Created At
15:32:18
Total Orders
1
Payment Aggregate
ID: PAY-2024-4123
SUCCESS
Order ID
ORD-2024-5892
Amount
$59.98
Method
Credit Card
Transaction ID
TXN-ABC123XYZ
Event Count
1
Processed At
15:25:33

📸 Aggregate Snapshots

Aggregate ID Type Version Snapshot At Events Since Size
ORD-2024-5892 Order 2 2024-01-20 15:28:12 0 2.4 KB
USR-2024-001 User 1 2024-01-20 15:32:18 0 1.2 KB
ORD-2024-5891 Order 5 2024-01-20 14:20:45 2 3.1 KB
PAY-2024-4122 Payment 1 2024-01-20 13:15:30 0 1.8 KB

📈 Read Model Projections

Projection Name Type Events Processed Last Updated Status
OrdersSummary Real-time 5,892 2024-01-20 15:30:45 Active
CustomerStatistics Real-time 2,341 2024-01-20 15:32:18 Active
SalesAnalytics Batch (Hourly) 12,547 2024-01-20 15:00:00 Active
InventoryView Real-time 892 2024-01-20 14:15:20 Active
PaymentHistory Real-time 4,123 2024-01-20 15:25:33 Active

📊 Orders Summary Projection

Total Orders
5,892
Confirmed
4,234
Pending
1,458
Cancelled
200
Total Revenue
$284,532
Avg Order Value
$48.32