Logo
Back

Applications and practical examples of microservices

Published on

October 05, 2021

Reading time

minutes

Tags

#Architecture #Blogartikel #Blogreihe Microservices #Microservice #Technologie

Before the advent of microservices infrastructure, leading companies such as Netflix, Ebay, Spotify, and others relied on monolithic architecture systems. A system is called "monolith" if it consists of interrelated functional aspects rather than separate architectural elements. 
Unlike monolithic and microservices, the latter are easier to understand and better suited for building flexible applications with logical services. For this reason, all the companies mentioned above have moved from a monolithic architecture to a microservice architecture. 
 

Practical examples

Ebay 
Like most systems, the eBay trading platform started as a monolith: at the time, eBay had 3.4 million lines of code in a single file. Because of this situation, it was decided to open up the monolith and develop microservices (in Java). At eBay, individual services communicate with each other via REST. 
 
The fact that eBay and many other companies have successfully transitioned from a monolith to a microservice architecture proves the usefulness of this more modern approach. While a monolith is sufficient in the early days of an online project with few active users and a manageable reach, this structure becomes a growth-inhibiting monster as demand increases. 
 
Netflix 
Netflix follows the same approach: Microservices implement REST interfaces that clients can use. The goal is not only to develop microservices independently, but also to scale them. Netflix relies mainly on Java for its implementation. Most of the tools and libraries in the Netflix universe are designed for this programming language. These tools are available as open source. Other technologies are also possible via a REST interface. Microservices thus provide much larger and more complex business functions. 
 
Spotify 
Another streaming service, Spotify, also uses microservices in its offering. The challenge for Spotify in its daily development work is fierce competition. With Apple, Amazon and Google, some of the largest information technology companies in the world are in the audio streaming market. At the same time, developers have to constantly respond to increasing demand due to rising user numbers and comply with certain business rules (for example, licensing rights). In order to release own product innovations faster and to be able to react quickly to new developments of competitors, microservices are the suitable solution for Spotify. 
 
For example, the feature that gives users suggestions as soon as they enter a search term is a standalone microservice managed by a dedicated team. Spotify benefits from the robustness of its microservice architecture: if one microservice fails, the entire product is not rendered useless. Spotify uses over 800 microservices. Incidentally, the streaming service also uses Java for most microservices.  
 

Example applications

Suppose a company creates an online store that uses the microservice architecture pattern and implements the product details page. The developers need to come up with multiple versions of the product details user interface: 
 
HTML5/JavaScript-based user interface for desktop and mobile browsers - HTML is generated by a server-side web application 
Native Android and iPhone clients - these clients interact with the server via REST APIs 
 
In addition, the online store must expose product details via a REST API for use by third-party applications.  
 
Another example:  
 
A company is developing an online store application using the microservice architecture pattern. Most services need to store data in some kind of database. For example, the ordering service stores information about orders and the customer service service stores information about customers.  
 
Services must be loosely coupled so that they can be developed, deployed, and scaled independently. Some business transactions need to enforce invariants that span multiple services. For example, the Place Order use case needs to verify that a new order does not exceed the customer's credit limit. Other business transactions need to update data owned by multiple services. 
 
Some business transactions need to query data owned by multiple services. For example, using View Available Credit must query the customer to find the credit limit and the orders to calculate the total amount of open orders. Some queries need to link data that belongs to multiple services. For example, to find customers in a particular region and their recent orders, customers and orders must be merged. 
 
Code 
 
Experiences with this approach exist not only in modern environments like online shops or online advertising, but also in traditional organizations like online magazines. Typical microservices in this scenario are very small, possibly 10 or 100 lines of code. Each of the microservices may implement part of the ad placement algorithm, for example. 
 

Overview of the entire blog series on microservices

Our blog

Related articles

just make it simple

Veljka Dugoševića 54 11050 Beograd Serbia

Mon - Fri 8:30 - 17:00

Copyright © 2024 asioso. All Rights Reserved.