# Polling Publisher

> Reliably publish DB-committed events to a broker by polling an outbox table.

- **Category**: Microservices
- **Subcategory**: Messaging & Events
- **Canonical URL**: https://designpattern.fyi/patterns/polling_publisher/

---

## Description
Clean, reusable architecture pattern.


## Use Cases
Order Service writes OrderPlaced to outbox table. Polling Publisher runs every 500ms, finds unpublished rows, pushes to Kafka, marks them published. No events lost even if the service crashed mid-operation.





## Trade-offs


### Advantages

- Simple to implement — just a scheduled DB query + publish loop

- No special DB privileges needed (vs transaction log tailing)

- Works with any relational DB

- Guarantees at-least-once delivery




### Considerations & Drawbacks

- Polling adds latency (events aren't published instantly)

- High-volume outboxes need efficient polling queries + indexing

- DB load from constant polling

- Not as efficient as log tailing for very high throughput







---
**Reference**: [Original Source](https://microservices.io/patterns/data/polling-publisher.html)

