π₯οΈ 1οΈβ£ Ops Dashboard (Operations Dashboard) β Basics for Interview
A central place where Operations / Support / Admin teams can monitor, view, search, and troubleshoot system issues quickly without needing developer help.
β Key features of a good Ops Dashboard (relevant to your project)
| Feature | Example in your project |
|---|---|
| Search / filter logs | Search paymentID = 123, see its history |
| Status visibility | See payment status = REFUNDED, FAILED, PENDING_MANUAL_REVIEW |
| Retry/Replay actions | Retry failed refund or API call from UI |
| Alerts & Notifications | DLQ has 5 failed refunds β Ops gets alert |
| Traceability | Trace full journey of transaction (via correlationID) |
| Audit Logs | See which Ops person retried/reconciled |
β¨ Tech stack (practical for your project)
| Tool | Use |
|---|---|
| ElasticSearch + Kibana | You already have for logs β can build dashboards |
| Grafana | (Optional) Nice dashboards with alerts |
| Custom Admin UI | A simple Angular admin panel to view/retry DLQ messages |
| DLQ Viewer | Custom page to view Kafka DLQ messages |
π‘ What to say in Interview? (Sample)
βIn our project, we use ElasticSearch and Kibana to create Ops dashboards where our support team can view failed transactions (like payment refunds), DLQ messages, and even retry or escalate them manually. This reduces downtime and ensures eventual consistency even when automated compensation fails.β
π¦ 2οΈβ£ Outbox Pattern β Detailed & Practical
π§ Problem first (why do we need it?)
In microservices: Letβs say your OrderService does this in a single REST API:
@Transactional
public void placeOrder(Order order) {
// Step 1: Save order to DB
orderRepository.save(order);
// Step 2: Send event to Kafka
kafkaTemplate.send("order-events", new OrderPlacedEvent(order));
}
β οΈ Problem β If Step 1 succeeds but Step 2 fails (Kafka down / network issue) β Your DB says βOrder placedβ β But no event was sent β Data inconsistency
π‘οΈ Solution = Outbox Pattern
Steps
- Instead of sending Kafka event directly, save event to a DB table (
outboxtable) Same transaction as business data β so both are safe
@Transactional
public void placeOrder(Order order) {
orderRepository.save(order);
OutboxEvent event = new OutboxEvent(
"OrderPlaced", order.getId(), LocalDateTime.now(), "PENDING"
);
outboxRepository.save(event);
}
- A separate background thread (poller) keeps checking
outboxtable If event status =PENDINGβ send to Kafka If successful β markSENTIf fails β retry or DLQ
ποΈ Outbox table schema
| id | event_type | payload | status | created_at |
|---|---|---|---|---|
| 1 | OrderPlaced | {orderId: 123} | PENDING | 2025-05-05 |
| 2 | PaymentRefunded | {paymentId: 987} | SENT | 2025-05-05 |
π‘ Key benefits
β No data inconsistency β Safe even if Kafka is down temporarily β Works nicely with exactly-once semantics β Can combine with Debezium (CDC) to automate event publishing (optional advanced)
βοΈ What to say in Interview? (Sample Answer)
βTo avoid dual-write problems between DB and Kafka, we follow Outbox pattern. Our services first save business data + event in same DB transaction. A poller then reliably publishes events to Kafka and marks them sent. This guarantees consistency even if Kafka is down momentarily.β
π Summary for You
β Ops Dashboard β Your Kibana + DLQ viewer β for Ops to see, retry, reconcile β Outbox Pattern β Helps when service emits events to Kafka after DB updates β to keep data consistent