Why You Should and Should Not Embrace Microservices Architecture?
Pavan Belagatti
GenAI Evangelist | Developer Advocate | 40k Newsletter Subscribers | Tech Content Creator | Empowering AI/ML/Data Startups ??
What are Microservices?
A microservice is a self-contained process that provides a unique business capability. Microservices combined to act as one large system, but behind the scenes, all consist of many microservices.
According to Wikipedia, A workshop of software architects held near Venice in May 2011 used the term "microservice" to describe what the participants saw as a common architectural style that many of them had been recently exploring.
Lately, Jeff Bezos from Amazon created the two pizza team approach, an ideal size for a microservices team. According to Martin fowler, "Microservices" became the hot term in 2014, attracting lots of attention as a new way to think about structuring applications.
Google trends popularity for the keyword 'Microservices.' is shown below
Impressed with these two amazing articles(below) on Microservices written by Manisha Sahasrabudhe, the co-founder of Shippable, I started understanding more about Microservices.
7 THINGS TO CONSIDER WHILE MOVING TO A MICROSERVICES ARCHITECTURE
WHY YOU SHOULD ADOPT A MICROSERVICES ARCHITECTURE
Developers use microservices to create new apps and to break apart old software applications into smaller pieces. A Microservices architecture not only helps software get released faster but also unblocks teams and creates better seamless processes for increased productivity.
Microservices act as an engine for the firms and enable them to improve software delivery speed, independence, and innovation.
Why Microservices?
Companies used to practice monolithic application approach that has most of its functionality within a single process that is commonly componentized with libraries. Now, there arises a major problem of scaling when the company wants it to, and the scaling happens only by cloning the app on multiple servers/VM's/Containers. The cost required to scale and maintain multiple servers in high. No company wants to have an overhead cost. So, on the other hand, Microservices architecture separates functionality into separate smaller services, where the scaling can be dome easily. Scales out by deploying each service individually creating instances of these services across servers/VM's/Containers.
A diagrammatic representation of microservices architecture is shown below,
Advantages of Microservices Architecture:
- Independent services, without any dependency, can have a high degree of scalability.
- Can be written in any language
- Very focused teams with clear ownership assigned
- Easy to find faulty code and respond back immediately
- Deploy often
- Reduced cost
Who Should Use Microservices Architecture?
Microservices are fascinating, and every company wants to adopt this pattern/architecture. But, before moving to embrace this architecture, it is essential to note some points to decide whether to approve it or not. It is discussed many times in many tech forums; Microservices are not for everyone.
- Small companies with limited IT resources find it difficult to adapt to microservices architecture.
- Operational complexity is enormous, and the team should know to handle it.
- Determining infrastructure requirements for microservices and then provisioning and maintaining infra for each microservice increases the degree of complexity that most Ops engineers working on monoliths are not accustomed.
- Load balancing and scaling approaches in microservices are a bit complex. You must know whether you want to scale the whole microservice or just the subset.
So, yes, having a Microservice has both advantages and disadvantages. You need to prioritize and analyze what existing problems in the company you want to fix and then decide whether to go for microservices architecture or not.
You might also be interested in reading my other articles on Microservices.