In this video, Rod Cope, CTO at Perforce Software, gives an overview of microservices, what they are, how they compare to the monolith, and an example of what the microservices architecture looks like in a modern application.

What Are Microservices?

Microservices are a new pattern. Some people call it an architecture that kind of turns traditional application deployment on its head. So instead of a, what we used to have is a three-tier type architecture or web server app server database that had all the functionality of an entire application in it. Uh, instead you're having teams create small pieces of functionality. So, they each do a little piece and then all those small pieces add up to be the whole.

What Are the Main Differences Between Microservices and Monolith Architectures?

One of the main benefits of a microservices architecture over a traditional monolith is that because you have small pieces, it’s easy to replace them because you haven't dedicated years of work on a particular micro service so you can move from one technology to a newer one. You can innovate faster, have much more flexibility. You're not locked into platforms for a decade at a time.

Another benefit of microservices architecture has to do with reliability of the overall app as well as efficiency. So, if you think about a monolithic app, in order to scale up to meet additional user load or demand, you have to essentially clone the entire architecture.

So, another copy of the database, the web server, the app server, all the functionality, all the business logic comes in one chunk. If you only need one little piece, you can scale up just that one. So microservices are more efficient when it comes to hardware and resources. Scale up just what you need as well as overall higher reliability.

Can You Give Me an Example of a Microservices Architecture?

An example of a microservice, you have a zip code lookup. You have a user interface, maybe it's a website, eCommerce site, somebody types in a zip code and you want to automatically populate their city and state, so they don't have to type it. Okay? So, a small, easy to understand service does one thing can do it well. So, the microservice team that implements that service can choose any technology they like.

They can build it with Java or with Node.js or with PHP or with Python. It doesn't really matter. They can use whatever data store they like. A typical SQL database, a no SQL database, a memory cache, lots of different ways to implement this. And there's no right or wrong answer. Each team that develops a microservice has the same kind of choices, but they do need to have some commonality overall, which is where you start to think about things like a service mesh.

A component like Istio that helps these microservices find and talk to each other. Let's say I have a shipping app, an ecommerce app, and I have a FedEx shipping lookup. So, in order to tell you how much money it will cost to ship your item, I need to know how big it is, how much does it weigh and what zip code are you in.

So, I might have my shipping microservice ask my zip code, lookup microservice for some information. So how do they do that? Do you hard code somewhere in that shipping service where these zip code lookup services? Well, if you do, now you're becoming more tightly coupled in the architecture. It looks more like a monolith. There's more overhead now you can't easily change technologies. The teams are moving more in lockstep, that can't be independent.

So, you lose some of the benefits of microservices. So, what something like Istio gives you is the ability to have this infrastructure component, handle the services, finding each other, communicating with each other, recording telemetry, data monitoring, data fail overs, different kinds of microservices deployment strategies to test new versions. And all that. So that the individual developer of that one zip code lookup service doesn't have to care about any of that. It kind of comes for free as part of this architecture.

JRebel and XRebel for Microservices

JRebel and XRebel can combine for improved microservices performance and developer efficiency. See this high-ROI combinatino in action in our video on JRebel and XRebel for Docker.

See Video