I'm new to DDD and CQRS and I'm planning to build a simple application to improve my skills a bit. What I'm planning to do is a simple Taxi Corp application.
Requirements:
- Client orders a taxi.
- Client can have only one order at a time.
- Driver picks an order.
- Driver can have only one order at a time.
- Driver goes to client.
- Client enters cab.
- Course starts.
- Course finishes.
- Client is purchased and driver is paid
And so on.
I can see there can be three aggregates: Client, Order and Driver. I want to split them into separate microservices. Do you think it's a good idea or I should start with one microservice?
I'm currently focused on the ordering a taxi. First of all I need to check if client doesn't already have a course assigned, later on I can create an order. After the order is created, I need to assign it to client. As during one request only one aggregate can be updated/created I wonder how to do it correctly. I've read something about Process Managers and I think it will be very useful in this case. I even draw a schema of communication. Can anyone tell me if my approach is correct and give me some tips on how to going further?
Someone said: "If you have more microservices than customers, you are doing it wrong".
And if you really follow CQRS/ES approach, resulting system is much easier to split apart than traditional ORM monolyths.
So focus on the domain first and start with monolyth.