thePHP.cc Logo Deutsch Contact
Microservices for Lunch

Microservices for Lunch

You are a software developer, and your are on lunch break. Today, you decide not to go for lunch with the team, because you have some shopping to do. You have been invited by a special person for the next day, and you want to bring along a nice gift. You enter your favourite shop, and manage to find a nice little something that will be the perfect gift for your host. You line up at the cashier. Luckily, you are at the front of the line very soon.

The cashier looks at your gift and mentions: "Oh, that is very, very nice indeed." She continues: "Please hold on for a moment", and disappears. After a few moments, she is back, and starts to search through a drawer, muttering: "I know it's here, Monday today, I'll find it any moment ... ah, here it is". Removing a price list from the drawer, she turns back to you, smiles, and then starts to flip through the pages, looking for the current price of your gift. Having found it, she smiles again and asks: "Would you like anything else?"

You decline, and she walks away again, with a quick excuse. A few minutes later, she is back with a colleague, who is still chewing on his lunch. You suddenly realize that you are very hungry. Time is running short for you to complete the purchase, and still grab some lunch.

The gentleman asks: "Would you like to buy any add-ons? We have multiple variations." Again, you decline. The cashier starts to ring up your gift. You ask about warranty, realizing your mistake as you speak. The lady starts to walk away again, saying "Let me find out for you". After two minutes, she returns with an answer.

Answering Time

Time is running little short now, you need to get back to work, plus you are really hungry. Still, you need a gift wrap. "Just a minute", the cashier says, and off she goes again. It takes quite long this time, but ultimately she returns with a sheet of the most beautiful gift-wrap paper, only to start searching through her drawers again.

"I am in a bit of a hurry", you say. She smiles as she explains: "Just a second, I have to find the sticky tape ...". Quite frustrated, you leave the shop without the gift wrap.

Being back at work, you continue to work on your assigned task. Your company is building a web shop, and you are currently working on the checkout. Your colleagues are working on a RESTful service that allows you to retrieve the product price in a given context. You are not clear on the details, but from what you have heard, it needs to perform a lot of calculations, because price rules are very complex. But this is none of your business.

This morning, you have finished working the REST client that talks to a recommendation engine and fetches related products. Currently, you are working on retrieving relevant product information from the cart service, and pass it on to the checkout service. Fortunately, you will not have to communicate back with the A/B testing engine, because this happens in the frontend.

However, your software will need to talk to another service to reduce product availability once the customers have completed the checkout. This should be quick, however. The only thing you are a bit concerned about is that service that the other team develops. It is responsible for packaging up digital goods for delivery, allegedly is really, really slow, and does not work flawlessly in some edge cases.

Latency Kills

Suddenly, you remember your personal shopping experience from earlier today. Something felt wrong when you were in that shop. Such a bad customer experience. You shake your head and continue reading through the API documentation of the cart service. Everybody in your company is very much into microservices these days, before that it was all about SOA, while nobody was really clear what that meant. But now, the world seems to have settled on RESTful microservices, which makes everything very easy. Just access all those services you need, using one ubiquitous protocol.

You think about your lunch break again. Wondering whether you might run into performance problems later, you create a ticket requesting to discuss the introduction of a caching layer in the next sprint. Thank God you never lack ideas.

Something still feels wrong.