Skip to main content

Posts

Showing posts from December, 2021

Serverless Microservices By Business Capability - Hotel

Microservices make life simpler. But, just like any other solution, if not done right, they can make life miserable too. In this post, I'd try to explore a few pitfalls and ways to get around. I'd use AWS serverless components all through. Take an example of a hotel. Say it has: 100 rooms, 10 Floors, 10 rooms per floor 50 King Bed Rooms, 20 Double Bed Rooms, 20 Twin Bed Rooms, 10 Suites 10 Housekeeping Staff who clean and maintain the rooms, 4 Inspection Staff who make sure that the cleaning has been done properly, 1 Housekeeping Manager Suppose we want to create an API for the hotel to be able to: Fetch the current status of the rooms - whether they are clean, dirty, need inspection. Update the status of a room Assign a housekeeping staff to a room Check the assignments of the housekeeping staff How can we design a fleet of services to solve this? This model might work: Although they all share the same database, each operation is fairly unique in its technicality. This can be ...