Serverless Event Based Microservice Kata
Kata Level: 3
1° Focus: Event based microservice
Time: 60 minutes
Challenge: Working with a C#/Azure shop and needing to introduce them to the concepts of an serverless event based microservice ecosystem. How better than to do it within the framework of a kata. We opted to use Azure Functions and Azure Service Bus for the listeners and eventing.
Result: As the group was mostly level 3 kata practitioners, we had a range of possibilities that were attempted and played with. What we settled on was a HTTP Function that choreographed a call onto a service Service Bus topic and waited for four responses on a different topic before returning a result. Our four listeners returned a message on a different bus with two pieces of data, a string and a priority; return string of int (priority 10), if %3 return "fizz" (priority 20), if %5 return "buzz" (priority 20) and if %15 return "fizzbuzz" (priority 30). Our listener would then return either "fizz", "buzz", "fizzbuzz" or int string, depending on priority.
Discussions: The discussions that were driven by this basic kata were great. There was great churning around if we should have int string, %3 and %5 (3 services) vs. int string, %3, %5 and %15 (4 services). Four services with priorities won the argument as it was more extensible and had less business logic in the choreographer. There were many more basic conversations like things such as a queue vs topic and synchronous vs. asynchronous. The key, as usual, was the conversations that were to be had. No one worried about how to solve FizzBuzz, that's old hat, so we didn't need to focus on the code challenge. Instead the focus was on exploring Azure Functions and how to come up with an event driven model. Everyone walked away with a much better understanding of Azure Functions, event driven microservices and Azure Service Bus.