Problemunvalidated

I cannot think of a way to set the `productId` of the new `Product` entity that doesn’t use a blocking database call — I have a Spring Boot microservice that provides non-blocking APIs for creating and managing entities called `Product`. The services uses a MongoDB. Tension: Ideally, I’d like an auto-increment feature that will do this on the entity itself when it is persisted to the database. Outcome: safe from race conditions.

5636cb6c-ba6d-4090-b3c4-689a83643fb7

I cannot think of a way to set the productId of the new Product entity that doesn’t use a blocking database call — I have a Spring Boot microservice that provides non-blocking APIs for creating and managing entities called Product. The services uses a MongoDB. Tension: Ideally, I’d like an auto-increment feature that will do this on the entity itself when it is persisted to the database. Outcome: safe from race conditions.