stackstash

Apache Kafka vs MongoDB

Apache Kafka and MongoDB are free.

A log that services publish events to, and other services read later.

Try it

Pros of Apache Kafka

  • Producers do not wait on every downstream service

  • You can replay events after a bug

  • It holds up once you actually have a stream of events

Cons of Apache Kafka

  • Running a cluster is a lot for one app

  • A database is the simpler choice until you need a stream

A document database that stores records as JSON-like documents instead of table rows.

Try it

Pros of MongoDB

  • Add fields without a migration

  • Documents map cleanly to JavaScript objects

  • Free Atlas tier to start

Cons of MongoDB

  • Joins and reports are harder than in SQL

  • Without a schema, data drifts out of shape

  • Atlas jumps in price past the free and Flex tiers