Microservices and APIs have been getting a lot of publicity, and there is some confusion about how they are related, and no — they are not the same thing. A microservice is an architecture that separates parts of a application into small, self-containing services (these are the APIs) The API is an interface; as one commentator states: APIs “are focused on self-service consumption of the asset, simplicity, security, analytics, and speed to deliver.”
In the past, the IT industry used monolithic or Service Oriented Architecture(SOA)-based solutions as the standard, but considering the growing complexity of today’s infrastructures, SOAs are not able to satisfy the consistently dynamic and growing demands. Microservices are designed to achieve a high degree of agility, fast delivery, and to scale.
Before we dive into the microservices architecture, there are some misconceptions about the services that we should clear up. First, the "micro"-part of the name might lead people to think this is a tiny service, and therefore shouldn't be doing complex functions, but that is not so. It’s true that a microservice is a small component, but it can represent a range of business capabilities, from large and complex to the very small; an example might be a login system or a payment engine.
Also, many people assume that microservices are a new kind of a protocol. But microservices is not new, nor is it a protocol. As touched on above, microservices architectures do use existing APIs like REST and SOAP services, AMQP, and JMS.
The basic concept of microservice is this: it is a small application that does one thing only, but it does that one thing very well. A microservice is:
While they are independently developed and deployable, a microservice isn’t an island onto itself. Normally there are many microservices in an architecture or in a solution that need to interact with each other. One microservice is a part of a larger ecosystem, running and working alongside other microservices to accomplish what would normally be handled by one large, standalone application.
Challenges with the old way of doing things, notably SOA, have led us to rely more on a microservice architecture. Splitting a monolithic application up into many small independent applications through concurrency or partitioning results in the application not being as efficient as we need it to be. If an application needs to process tasks, we usually assume the more efficient the process the better. With time, the application will grow along with business capabilities, and as features get added, and traffic increases. This leads to decreased speed and efficiency, and eventually the time will come when it needs to scale up, and in the pre-microservices days, concurrency and partitioning were the primary methods for breaking up tasks.
Ultimately though, concurrency and partitioning are difficult to support when you have one large application that needs to be deployed to every server, which needs to be processing any type of task. Vertical scaling had often been the remedy when applications got complicated. This is achieved by either increasing the hardware side and adding more servers, (deploying a copy of your applications to the other servers) or vertical scaling the application. This method increases efficiencies but makes the application more complex.
A microservice requires a large infrastructure and should be built from the ground up. Microservices are not isolated — they are built to run and interact in a unique environment — the microservices ecosystem.
Microservices must be built with sustainability in mind; with the ability to know how to stabilize the environment, how to scale, and be reliable and fault-tolerant. A best-practice microservices ecosystem can be split into four layers:
Microservices are an increasingly popular architecture for software and application development. Their modular style enables continuous delivery practices. businesses are increasingly turning to microservices for their development and cloud application architectures. We invite you to explore how to build microservices using Talend Open Studio for ESB.
Microservices are an architecture style used by many organizations for software development. There are a number of different ways to define microservices, but a common definition comes from Martin Fowler: "The microservice architectural style is an approach to developing a single application as a suite of small services. These services are built around business capabilities and are independently deployable." Fowler’s definition continues: "There is a bare minimum of centralized management of these services, which may be written in different programming languages."