2

I'm running multiple python microservices that should use Cassandra as their database. In the spirit of microservices, each one "owns" its data, but is free to emit the data to anyone willing to listen. All of the microservices are communicating with each-other via kafka.

For example, I could have a microservice called auth that own private data about users. When a user updates his username or email, the change needs to happen in the auth-owned database. But, there are other microservices (e.g. scheduler) who can have a copy of all usernames.

The question is - what is the best way for auth service to notify scheduler service about data changes. In Mongo, I would use Change Streams.

1 Answer 1

2

Cassandra doesn't have ready-to-use functionality like "Change Streams" in Mongo. Cassandra has Change Data Capture (CDC), but you need to write a code to consume the changes, you'll get the same changes on all nodes that hold the replicas, you don't get notifications about data expired via TTL, etc.

I personally would implement all communication via Kafka, and used something like DataStax's Kafka Connector for submitting data to different databases/tables (it's not open source, but it's free for usage with both DSE & Cassandra).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.