A microservice journey - part 3: Agile and Microservices

Agile has been around for a while now, and has been proven to be tricky to implement and returns questionable value.

I have seen lots of different forms of agile, and sometimes the ceremonies get all the focus, and the essence of agile is lost. Especially for big corporates, they need to scale out this approach, so it becomes a playbook of steps you need to do.

As we move into microservices, adopting agile was a critical aspect. Being able to change direction or approach means microservices can evolve as we go, rather than being predefined right at the beginning. This is an extrealmy important aspect of microservices. Generally in a monolith, the patterns are established and followed without question. Changing a pattern is hard, and needs commitment, and understanding from everyone. Microservices on the other hand, mean every domain can use a different pattern, and we can grow and develop the right pattern as we go. Whereas a change like this is massive in a monolith.

Test and learn

A big benefit of microservices is the test and learn approach it enables. We should be able to bring up a microservice into prod without affecting anything. Bring up a microservice in a sprint, test with a subset of customer and either iterate and keep developing, or give up and throw it all away. 
A major problem with large scale application with lots of customers is building the right thing. We can have really good ideas, but how do we test what we think is right?? Deploy it! Test it in prod. Get customers to validate it. Big companies can not make these changes Willi nilli, as a change to a monolith can have deviating ripples effects. But to release a separate service with zero impact on the existing production stack is a much more palatable situation. It also gives us the opportunity to test ideas with customer and allow the customer to shape the final solution. This is game changing.

Evolution

Architecture is never finished. If you think it's finished, then you have either lost interest of lost the drive to innovate. To embrace this philosophy, microservices and Agile work together to make things better. A key ceremony in Agile is the retrospective. This gives the team to tool to reflect on what happened and decide how they can change something to make it better. Because microservices are small and isolated, this same logic can be applied to microservices and evolving the architecture with every initiative. Tech debt is a problem in every organisation, but it is also an opportunity to evolve the architecture in meaningful ways. Tech debt is a massive issue in a monolith, as it can severely restrict innovation and progress. As stuff is built decisions are made all the time, which pattern to use, how to structure the code etc. Sometimes the wrong decision is made but not realised until a long time after and it is released and it officially becomes tech Dept. At this stage, the problem has been build on top of and reused. To change anything like this is extremely hard as it means refactoring massive amounts of code (depending on how long it took to realise it was tech debt). With a microservice all the code is separated into much smaller domains. So the blast radius is contained to one microservice. You can't reuse something that isn't there. You can build new tech debt but again it is limited to the one microservice. With each new microservice you can choose to start again and evolve the architecture without having to refactor massive amounts of code.

Ownership

I have already spoken about the importance of keeping good people, and the importance of ownership. Agile is all about the team feeling empowered to define what they are delivering and have the power to affect the final product. Microservices enables this because each team decides how the microservice is structured, what it does, how it works. This autonomy means the team doesn't just own the work in the sprint, but also extends that same mantra of autonomy to the final product. This is such a critical aspect of keeping good people. Good people also have really good ideas, and these ideas can be used in other teams, which can make things even more interesting and enable other to look at thing differently, which generates more ideas. Kind of like a self fulfilling prophesy.

Servant leadership

This is an important concept in agile, and just as important for building microservices. I have been an Architect for some time now, and everywhere I have been the Architect leads the design and the developers build what the Architect says (sometimes... Actually wait?!), and the testers test it. In an Agile world, the team own the process and deliver as a team, so why not the design too. If we think about the value of servant leadership and apply it to Architecture, why should one person or small group of people be making all the decisions? Being a servant leader in this space means stepping back and allowing designs to be owner by the team themselves. Architecture is still important, but more of a leadership role helping the teams make the right decisions, rather than designing everything and carrying a big stick around. Architecture becomes a member of the extended team making sure the decisions being made are the right ones for any upstream or downstream systems. Architecture makes sure we don't duplicate work or build something which is not compatible with something else. This lends itself to ownership, accountability, commitment. As talked about before, good people build good software. to keep good people they need to feel like they are making a difference and own these services they are building.

A good video on servant leadership can be found on youtube (its only 12 minutes long)
https://www.youtube.com/watch?v=lmyZMtPVodo&feature=youtu.be

One of the promises of microservices is the ability to scale out, and yes this is most definitely true. As we endevour to build more things, we can quickly add more people to build those new things. But how can we scale out if one group of people is/are the bottleneck? We would need to build Architecture at the same rate to keep things moving. But Architecture is more about knowing the lay of the land, and making sure things fit, rather than designing and building stuff. So getting new Architects and training them up on the ecosystem is hard, and can take a long time.


Fail fast

I think this term is wildly miss-understood. I believe fail fast refers to testing an idea quickly to see if customers like it or not. NOT cutting corners to delivery things quickly. Unfortunate facebook has made this catch cry popular and now people are using this as an excuse to build sub-optimal solutions with the intent of coming back and fixing them when they "fail fast". 
Microservices enable this "fail fast" (not the corner cutting version) by building a framework which allows us to plug in new components in a consistent and safe way. We can easily add new features without disrupting production, and just as quickly remove them if they do not pan out. By having a distributed system in nature itself promotes this modularity, and hence is a key enabled for this type of experimentation. Agile and Lean talk about these concepts and microservices help delivery that vision in a safe way.

Comments

Popular posts from this blog

What good looks like!!

A microservice journey - part 2: what type of micro service are you?

Validation Rules