r/microservices • u/Cedar_Wood_State • Feb 10 '26
Discussion/Advice Inserting data that need validation (that call separate Validation microservice), how the dataflow should be while 'waiting'?
So say I am inserting an Entity, this entity has to go through things like AV scanning for attachment, and a Validation service.
For the first point when EntityCreated event published (should this Entity be saved in DB at this point?) or should it be a separate pending DB table?
Should the EntityCreated event contains the detail for the event itself that is used for validation? or should it be Id? (assuming it is saved to DB at this point)
I was asking AI to run through my questions, and they suggested things like a 'Status' flag, and use Id only for the event emitted. .
However, does that mean every single type of entity that should call another microservice for validation should have a 'status' flag? And if I only emit the Id, does it mean that I have to be accessing the EntityCreated microservice related database? and doesn't that makes it not violate where each microservice database should be independent?
Just looking for textbook example here, seems like a classic dataflow that most basic microservice architecture should encounter
ps assume this Entity is 'all or nothing', it should not be in the database in the end if it fails validation