Over the last 20 years, organisations around the world have begun breaking down their monolithic architectures into smaller and more manageable components. This paved the way for the emergence of the service-oriented architecture (SOA), where applications were broken down into their functional components.
Then, in the last 10 years, we broke these down even further with the microservices pattern, which aimed to address the inherent problems found within monolithic SOAs.
However, that doesn’t mean that the monolithic architecture is dead.
According to Mike Amundsen, author of books such as "Design and Build Great WebAPIs", and "Microservice Architecture: Aligning Principles, Practices, and Culture", a good monolithic system still has its place.
"One of the advantages of a monolithic system is once I get my request or my data into the perimeter of your system, then everything is nearby. The database is local, all the other functions, all the other classes, all the other modules — they're all local. And I don't have to worry a lot about network traffic until I want to give a response back to the client." said Mike during an interview in Coding Over Cocktails, a podcast by Lonti previously known as Toro Cloud.
Microservices and loose coupling
The pros and cons of microservices lie with their very nature – loose coupling.
"With microservices, I can't be sure that all of those tasks I need to do to fulfill your request are living in the same space. They might be on another machine. They might be in another part of the company. They might actually be run by some of the third party that might be hosted in the cloud by a major vendor. So, now I have to design with the assumption that everything is far away, that everything is actually connected by some network requests and that network requests might even go down." Mike explains.
However, it is also with loose coupling that developers are empowered with frequent and rapid deployments, allowing them to push out features and capabilities to their customers and/or users a lot quickly.
Apart from this, microservices can also be developed in several programming languages, communicating via language-neutral protocols such as REST. Enterprises can also run their applications in the cloud and route data to the required databases and endpoints through the use of APIs.
Microservices and APIs
APIs are often used to solve customer problems, running north to south (customer request to actual service) within the system. On the other hand, microservices are usually generic data, workflow, or internal systems that run via east-west access to communicate with other microservices.
"So making sure that you sorta know how the two function is super important because that helps you focus on who the audience is and what their problems really are, and then what your risks really are, because they are different on the inside than they are on the outside." Amundsen says.
Microservices may present several challenges upon implementation, and according to Amundsen, no matter how well you do it, the first time you do it, you won’t do it correctly.
"You'll come up with your best guess, your best understanding. And that's really important, but you still get it wrong. But that’s okay, because you just build it and then you work with it and then you change it over time. And of course, because we're going to be doing constant renewal, we're going to use that star method, that cycle of repeat. It's okay. We do the best we can, as we understand today, and then build that and then pay attention." he further explains.
Mike Amundsen is an internationally known author and speaker who consults with organisations worldwide on network architecture, web development, and the intersection of technology and society. He works with companies to help them capitalise on the opportunities provided by API APIs, microservices, and digital transformation.
Coding Over Cocktails is a podcast created by Lonti previously known as Toro Cloud, a company that offers a low-code, API centric platform for application development & integration.
This podcast series tackles issues faced by enterprises as they manage the process of digital transformation, application integration, low-code application development, data management, and business process automation. It’s available for streaming in most major podcast platforms, including Spotify, Apple, Google Podcasts, SoundCloud, and Stitcher.