Microservices Use Cases

Practical examples and the best practices for all types of organizations

quote icon

"Making decisions in system design is all about trade-offs, and microservice architectures give us lots of trade-offs to make"

Sam Newman

Building Microservices: Designing fine-grained systems

Yet some companies, as well as startups used to design their infrastructures in a monolith menner. The reason for this was a need for faster deployments and absence of extra time for implementing best practices - they wanted their business to grow faster, to move further. We can't blame them for this.

startup

That's why the tendency says - most companies nowadays refuse from monolithic architectures in favor of microservices and no wonder! A microservices architecture offers great opportunities for organizations of any size and even enterprises, with a tech stack chock full of a bit outdated technologies, gradually "break" monoliths and transform the architectures. Startups consider microservice consulting services to build architecture from scratch to operate as Netflix does it.
However, there is other side of the coin - not every application fits the principles of microservices architecture, no matter how complex it is. Any decision towards any technology bears not only advantages, but some risks and inconveniences.
In this article we look upon the microservices and use cases, its benefits and disadvantages.
Anyway, they all are facing the same problems - monolith systems are extremely inflexible and don't allow to rebuild or refactor the units quickly, without big impact on end-users and business itself. Another fat problem, after a while, is growth (!) - the code becomes more complicated, the documentation is more confusing, and it becomes more difficult to maintain and manage the infrastructure. More often than not, companies would need more human resources to cope with it.

What is microservices architecture

Quickly about main terms definitions.

Microservices architecture
is a style of software \ application development that is based on building small independent units, where limited in size batch of services (or even a single service) defines a special process. Meanwhile, these units communicate between each other, executing the predefined logic of the application.

monolith vs microservices

Developers implement it to achieve safer deployments (because each service is deployed independently and doesn't influence the work of the entire system) and decrease the large-scale user intervention.

What problem of the monolith application do microservices solve?

Poor flexibility
Monolith applications resist implementation of various cutting-edge technologies. It can't be even easily migrated to the cloud.

Unreliability
In case if a system unit fails, the entire monolith system would also fail. It causes frequent downtimes.

Challenging scalability
The entire system must be rebuild in order to be scaled. A new technology can't be also easily implemented, because everything is dependent and not always compatible with the desired technology to be implemented.

Interdependence of dev teams
Dev teams have to adapt to each other, because some modules await the completion of development of some other ones.

Dependency of modules
Modules have to be developed one after another, so it doesn't allow the simultaneous development to reach the market faster.

Advantages of microservices

Microservices architecture design is a kind of complicated thing to start, afterwards it serves as a mightful benefit for application maintenance and further scaling and enhancing. Moreover, microservice-based applications are a priori cloud-native, allowing implementation of the best DevOps practices.

Each company distinguishes its own benefit using such architectural style, but the most common advantages are:

  • Easier deployment
    Each module is independently deployable. No need to prepare the entire application architecture to deploy.
  • Less Dependencies
    Since all the modules are isolated, they become independent from each other. It brings clarity and "transparency" into the whole infrastructure.
  • Faster defect identification and recovery
    Monitoring tools can quickly identify the failed module and you will be able to isolate it at once for further recovery.
  • Less risks and fault tolerance
    The full application wouldn't crush if a module goes down. It will just continue working as usual.
  • Easier integration with third party services
    No need to refactor the entire infrastructure to implement new tools.
  • Polyglot system
    Microservices can be developed using almost any programming language. The most widespread are Golang, Java, Python, Ruby, NodeJS.
  • Easier service upgrade
    If there is such a need, you can upgrade a single service instead of upgrading the entire system.

pc tools

Disadvantages of microservices

As any coin has two sides, microservice-based architectures also bear some inconveniences and tangible drawbacks. That's why microservices are not great fit for every case - though, we will talk about it later.

If microservices are built not using best practices (as it Netflix does), companies meet many challenges on the way. Though, even if the architecture is built properly, some problems may still pop up:

  • Requires great efforts to implement from scratch or refactor the monolith system.
  • Complicated testing across distributed environments.
  • Complex infrastructure requires a lot of services what brings confusion.
  • More difficult management with increase in number of services.
  • Requires properly set up load balancing and message formats because of network latency and low fault tolerance.
  • Sometimes can be more expensive because of remote calls, grained remote APIs, etc.

Nevertheless, these disadvantages are more easy to eliminate than disadvantages of monolithic systems.

Characteristics of the microservices-based applications

There is no common model or unified architectural style for microservices. Anyway, there are remarkable characteristics.

  1. Multiple units. Application is composed of multiple component services. Multiplication of the services is the first step towards achieving independency among services.
  2. Limited functional capabilities. Each service has limited functional capabilities, i.e. so-called functional boundaries. It helps dev teams implement small tweaks or even significant changes without sync up with other teams.
  3. Massive tooling. Microservices-based architectures usually involve great many tools and platform.
  4. Shift from centralized systems towards decentralized ones. Dev teams try to create reproducible tools, i.e. the useful tools that can be used by other engineers to help them solve the common problems. Decentralization characteristic is also proven by the fact that each service within the microservices-based architecture utilize its own database, opposite to monoliths operating a single database across all applications.
  5. Smart routing. Simple routing is the key distinguishing feature of microservices.
  6. Cross-functional teams. Each team is responsible for the product, not its separate part.
  7. Fault tolerance. As it was mentioned earlier, microservices have a great stability during operation. The rough description would be like the scenario below:

diagram

1. All services are bounded all together.
2. Sudden failure of the service.
3. The neighbour services continue working in the usual way, and the failed service is still bounded in the chain.
4. Once the service is up again, it continues working in normal mode.

Giants' microservices architecture use cases

As it was already mentioned, not every infrastructure can be successfully rebuilt and broken into smaller parts. But industry giants showed the best microservices use cases:

companies logos

companies logos

Microservices use cases examples

As you can see, microservices-based architecture is fairly very ambiguous thing - from one side, it's a disruptive solution used by industry giants and companies with large-scale applications due to its flexibility and independency. From another side, this solution slows down the development because of its complex integration and makes testing hardly possible. So what are the use cases for microservices?

  • Legacy applications refactoring. This is a common case, when enterprises decide to rebuild their IT capabilities in order to, for example, change the functionality or add some new features, move to cloud or just conduct global system modernization. Microservices enterprise architecture is usually build incrementally and involving bulk human and technical resources.
  • Applications dealing with big data, AL/ML is one of the best use cases for microservices architecture. Big data apps require a complex data pipeline-oriented architecture, where each stage is managed by one (or a few) particular task, e.g. data collection, processing, delivery, storage etc. Such "loosely coupled" units are great fit for microservices.The same is
  • Real time data processing applications. The most common use cases are streaming platforms like YouTube or SoundCloud, e-banking applications, radar systems, traffic control systems, online booking etc. I.e. the applications, executing operations in real time to deliver an immediate output
  • Large-scale systems with complex logic. Dramatically growing organizations (e.g. social media, social networks, media) require outstanding flexibility and scalability, that microservices architecture exactly provides. It helps companies quickly find the bottlenecks or invoke new cutting-edge technology to make it possible. Moreover, ability to deploy frequently on service-level enables even faster scalability.
  • (Third-party) Applications serving a big amount of users simultaneously.
  • Rapidly growing applications providing third-party services (like plugins, data transfer apps, analytics and monitoring tools, data indexes, etc). Such applications require more resources like RAM / CPU and services to operate because of their massiveness and complex logic. Though, such applications also require enhanced stability and almost 100% uptime not to lose the customers they serve.

To summarize

Microservices-based architecture is an ambiguous thing. It offers incredible flexibility and independency, though, it also brings tangible inconveniences and problems with development. Anyway, both monolith and microservices have its pros and cons and you just have to decide which way best suits you.

Alpacked's microservices cases

Let's arrange a free consultation

Just fill the form below and we will contaсt you via email to arrange a free call to discuss your project and estimates.