I’m trying to define best practices for complex scenarios, when something can go wrong in my projections. Let’s image I have an aggregate ‘Account’, and I store events in one stream per account.
Then, I have two projections. One projects data to DynamoDB. The second projects data to ElasticSearch to perform complex queries more efficiently.
What would it happen if one of the projections is faster? How can I sync these two projections? If I don’t do so, it might happen that I get search results in ElasticSearch, but I don’t have data yet in DynamoDB. I guess I could have both as part of the same projection, but as far as I know, best practice is having one projection per read-model.
I’m using checkpoints for these projections. How should we handle errors while projecting data? Imagine I have a problem projecting data for Account_1 to DynamoDB. Can I stop projecting data only for Account_1? Should I stop projecting data for every account?
If I have a problem projecting Account_1 to DynamoDB. Should this affect the projection for ElasticSearch? What is the best way to handle these errors?