Suppose we have two microservices, Customers and Orders, with no dependencies between them, i.e. they don't call each other, they don't know each other. Every order, though, has a reference to a customer by means of a customer id. In other words one customer may have zero or more orders, and one order belongs to exactly one customer.

For the sake of the example, it's totally fine to delete a customer **unless** there are orders belonging to that customer. What is the most appropriate way to implement a constraint on Customers that prevents a customer from being deleted if one or more orders have a reference to that customer? Analogous to referential integrity in a relational database.

These are the approaches I can think of:

1. Let Customers ask Orders if a given customer has any orders, e.g. via API call.
2. Let Customers keep track of which orders are assigned to every customer, e.g. by having each customer record maintain a list of order ids.
3. Merge Customers and Orders into a single microservice and manage it internally.

I'm not sure which approach is the best for the given example in a microservices context. I can see pros and cons in all three approaches but I won't list them here because I'd like to hear other people's thoughts on the problem, including approaches not listed above. Thanks.