/outboxen

Library to reduce boilerplate when implementing the transactional outbox pattern in Go

Primary LanguageGoMIT LicenseMIT

outboxen

Go Reference

Outboxen is a library for implementing the transactional outbox pattern in Go.

I found that there weren't many libraries for implementing this in Go, and the ones that did exist made different design trade-offs than I would make.

For an example using MySQL via GORM, see the outboxen-gorm example here.

Features

  • Makes no assumptions about your storage mechanism, you provide:
    • A way to atomically claim entries in storage for a given processor
    • A way to retrieve entries claimed by a given processor
    • A way to delete entries
  • Compatible with horizontal scaling
    • Safely claims outbox entries for publishing, with a deadline for gracefully tolerating failures
  • Designed not to interfere with the transactional part of "transactional outbox pattern"
    • It does not create transactions for you
    • You write entries to your outbox storage in the same transaction as your state modification

Drivers