My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Microservices Architecture

Constantine Harper's photo
Constantine Harper
·Aug 21, 2018

There’s hardly a tech entrepreneur who has never heard of microservices, an emerging style of application development. However, with all the tech disruption, most concepts don’t go beyond a buzzword. So microservices architecture can ring as yet another overhyped idea to most of us. Okay, Netflix, Amazon, eBay have migrated to microservices. So what? What with all the complexity of the MSA? What on earth can beat the good old monolith?

Life can. Business environment is all about disruption and digitization, smarter business models, faster way to market, a battle of UX’s, cloud-native & serverless all, ambient computing, and information security. New business reality asks for more flexible, resilient, fault-tolerant, device-agnostic solutions, where complexity is an intrinsic hallmark of a system excellence.

And the first step to excellence is awareness.

In this post we’ll make a brief introduction to microservices architecture (MSA): its essence, good and bad, whether you need it, and how to implement it.

What is microservices architecture

Not all software systems are made the same. In fact, there’s a full spectrum – from ‘monoliths’ (giant one-piece bundles of code) to ‘microservices’ (tiny single-function apps communicating with each other).

Microservices architecture focuses on creating software as single-function components (microservices) with well-defined interfaces and operations that communicate via APIs.

Microservices_architecture_vs_monolith[1].png

But microservices architecture isn’t just mere unbundling of a monolith. What counts is how various functionalities are identified as business capabilities and then split as fully independent, fine-grained, and self-contained microservices. So this software development architecture has certain distinctive features making it more desirable for some business cases than others.

The standards of microservices architecture

An application designed as microservices will most certainly have some, if not all, of these characteristics, that may well count as the standards of MSA.

Standards-of-microservices-architecture[1].png

Multiple components

An app is a suite of components communicating via APIs. That allows to develop, tweak, scale, and deploy them faster and without threatening the integrity of an entire application.

One thing done well

Each component focuses on a single specific function. A rule of thumb reads ‘as small as possible, but as big as necessary’ to represent the domain concept they own. If the code gets too complicated over the time, a component can be further split.

Decentralized

A product is designed as distributed systems with decentralized data management. In a microservices application, each service usually manages its unique database. It also favors distributed governance that allows others to benefit from the app.

Simple routing

Microservices utilize the principle of smart endpoints and dumb pipes. It runs similarly to the classical UNIX system. All the business logic is located within the services, leaving the communication between the nodes as lightweight as possible.

Failure resistant

No service is immune to failure. Microservices, however, are ‘designed for failure’. That means a single service failure doesn’t lead to the entire system shutdown. Other services (replicas) will take over just-in-time, provided there’s a valid monitoring system.

Evolutionary

This sort of architecture suits long-term systems that evolve so you can’t anticipate the devices communicating with the app. A monolith can evolve into microservices, too, if unforeseen requirements urge adding components that interact with the older system via APIs.

Potentially polyglot

Implementation details of one service should not matter to another. The services are decoupled from one another and built autonomously with the language, tools, persistence store, and methodology a team finds appropriate.

Infrastructure automation

Build and deployment automation is mandatory when working with microservices. When we have dozens of services running as independent processes to come together as a single application, manual deployment is bound to produce failures.

Independent

Each component is built, deployed, modified, or scaled independently and on demand. This enables multiple teams to work independently. Isolatability, as well as single-function, less dependable, readable code makes it faster to build, easier to test, deploy, rewire, scale.

Products, not projects

Instead of engaging in projects (the traditional way), cross-functional teams build products of individual services that communicate via message bus.

Built for businesses

The principal focus in the architecture is business capabilities and priorities rather than technology or various app layers. The principle ‘you build it, you run it’, aka DevOps, makes the teams build and maintain the product throughout its lifecycle...

Source

Wrapping up

To build or not to build your application as microservices? Depends on your ultimate goals, readiness to cope with challenges and understanding of the future. Distributed systems, cloud-native and serverless all, fast pace are just a taste of the things to come. With the complexity of the MSA comes its fault tolerance, flexibility, device agnosticism, and many other benefits. The method is new, the tools are nascent, but it’s there to stay and make many a project shine with new colors. Need more guidance? We’re here for you.