A Quick Primer on Microservices

Microservices are a type of software architecture where large applications are made up of small, self-contained units working together through APIs that are not dependent on a specific language. Each service has a limited scope, concentrates on a specific task and is highly independent. This setup allows IT managers and developers to build systems in a modular way. In his book, “Building Microservices,” Sam Newman said microservices are small, focused components built to do a single thing very well.

Martin Fowler’s “Microservices – a Definition of This New Architectural Term” is one of the seminal publications on microservices. He describes some of the key characteristics of microservices as:

History of Microservices

The phrase “Micro-Web-Services” was first used at a cloud computing conference by Dr. Peter Rodgers in 2005, while the term “microservices” debuted at a conference of software architects in the spring of 2011. More recently, they have gained popularity because they’re able to handle many of the changes in modern computing, such as:

The concept of microservices is not new. Google, Facebook, and Amazon have employed this approach at some level for more than 10 years. A simple Google search, for example, calls on more than 70 microservices before you get the results page.

Also, other architectures have been developed that address some of the same issues microservices handle. One is called Service-Oriented Architecture (SOA), which provides services to components over a network, with every serviceable to exchange data with any other service in the system. One of its drawbacks is the inability to handle asynchronous communication.

How Microservices Differ From Service-Oriented Architecture

Service-oriented architecture (SOA) is a software design where components deliver services through a network protocol. This approach gained steam between 2005 and 2007 but has since lost momentum to microservices. As microservices began to move to the forefront a few years ago, a few engineers called it “fine-grained SOA.” Still others said microservices do what SOA should have done in the first place.

SOA is a different way of thinking than microservices. SOA supports Web Services Definition Language (WSDL), which defines service end points rigidly and is strongly typed while microservices have dumb connections and smart end points. SOA is generally stateless; microservices are stateful and use object-oriented programming (OOP) structures that keep data and logic together.

Some of the difficulties with SOA include:

Problems Microservices Solve

Larger organizations run into problems when monolithic architectures can’t be scaled, upgraded or maintained easily as they grow over time. Microservices architecture is an answer to that problem. It is an architectural style software where complex tasks are broken down into small processes that operate independently and communicate through language-agnostic APIs.

Monolithic applications are made up of a user interface on the client, an application on the server, and a database. The application processes HTTP requests, gets information from the database, and sends it to the browser. Microservices handle HTTP request/response with APIs and messaging. They respond with JSON/XML or HTML sent to the presentation components. Microservices proponents rebel against enforced standards of architecture groups in large organizations but enthusiastically engage with open formats like HTTP, ATOM and others.

As applications get bigger, intricate dependencies and connections grow. Whether you are talking about monolithic architecture or smaller units, microservices let you split things up into components. This allows horizontal scaling, which makes it much easier to manage and maintain separate components.

The Relationship of Microservices to DevOps

Incorporating new technology is just part of the challenge. Perhaps a greater obstacle is developing a new culture that encourages risk-taking and taking responsibility for an entire project “from cradle to crypt.” Developers used to legacy systems may experience culture shock when they are given more autonomy than ever before. Communicating clear expectations for accountability and performance of each team member is vital.

DevOps is critical in determining where and when microservices should be utilized. It’s an important decision because trying to combine microservices with heavy, monolithic legacy systems may not always work. Changes can’t be made fast enough. With microservices, services are constantly being developed and refined on-the-fly. DevOps must ensure updated components are put into production, working closely with internal stakeholders and suppliers to incorporate updates.

The Move Toward Simpler Applications

As DreamWorks’ Doug Sherman said on a panel at the Appsphere 15 Conference, the film-production company tried an SOA approach several years ago but ultimately found it counterproductive. Sherman’s view is that IT is moving toward simpler applications. At times, SOA seemed more complicated than it should be; microservices were seen as an easier solution than SOA, much like JSON was seen as simpler than XML and people viewed REST as simpler than SOAP. We are moving toward systems that are simpler to build, deploy and understand. While SOA was originally designed with that in mind, it ended up being more complex than needed.

Another panelist, Allan Naim, product manager at Google, agreed. He explained that SOA is really geared for enterprise systems because you need a service registry, a service repository and other components that are expensive to purchase and maintain. They are also closed off from each other. Microservices handle problems that SOA attempted to solve more than a decade ago, yet they are much more open.

How Microservices Differ Among Different Platforms

Microservices is a conceptual approach, and as such it is handled differently in each language. This is a strength of the architecture because developers can use the language they are most familiar with. Older languages can use microservices by using a structure unique to that platform. Here are some of the characteristics of microservices on different platforms:

Java

PHP

REST-style PHP microservices have been deployed for several years now because they are:

Python

Node.js

Node.js is a natural for microservices because it was made for modern web applications. Its benefits include:

.NET

In the early 2000s, .NET was one of the first platforms to create applications as services using Simple Object Access Protocol (SOAP), a similar goal of modern microservices. Today, one of the strengths of .NET is a deep presence in enterprise installations. Here are two examples of using .NET microservices:

Responding to a Changing Market

The shift to microservices is clear. The confluence of mobile computing, inexpensive hardware, cloud computing and low-cost storage is driving the rush to this exciting new approach. In fact, organizations don’t have any choice. Matt Miller’s article in The Wall Street Journal sounded the alarm; “Innovate or Die: The Rise of Microservices” explains that software has become the major differentiator among businesses in every industry across the board. The monolithic programs common to many companies cannot change fast enough to adapt to the new realities and demands of a competitive marketplace.

Service-oriented architecture attempted to address some of these challenges but eventually failed to achieve liftoff. Microservices arrived on the scene just as these influences were coming to a head; they are agile, resilient and efficient, qualities many legacy systems lack. Companies like Netflix, Paypal, Airbnb and Goldman Sachs have heeded the alarm and are moving forward with microservices at a rapid pace.

 

 

 

 

Top