EN
E-Commerce Updated

Microservices: Is Your E-commerce Company Ready to Follow This Architectural Style?

Kateryna Kosmyna

Kateryna Kosmyna

Market Researcher

Author

Microservices: Is Your E-commerce Company Ready to Follow This Architectural Style?

Time to read: 13 minutes

Content

  1. Quick readiness check
  2. What Are Microservices?
  3. Micro Frontend: How Does It Relate to Microservices?
  4. The Benefits of Microservices Architecture over Monolithic Architecture
  5. When You Should Shift the Focus from Monolithic Systems to Microservices
  6. Final Say
Bookmark

Most ecommerce companies are ready for microservices only in part, and that is fine. The architecture pays off when several teams need to change and release parts of the store independently, or when one part of the system has to scale very differently from the rest, and when you can already provision servers quickly, monitor every component and deploy automatically. Without those conditions, a well-structured monolith is cheaper and safer; the usual first step is to extract one capability, such as loyalty or search, as a separate service next to the store. The three-question check below tells you which of these situations you are in.

In ecommerce, the microservices approach to software architecture has become a common alternative to the traditional monolithic approach. It opened broad prospects for digital businesses, and it also brought new costs that are easy to underestimate.

By giving a clear understanding of the idea of microservices, we want to help your business decide whether, when and how far to follow this architectural style.

In this article, you will find a succinct overview of microservices, the prerequisites for adopting them, and a monolithic vs. microservices comparison in terms of cost-efficiency and sustainability.

Quick readiness check

Answer the questions in order. A "no" to question 1 or 2 tells you where to stop for now.

#QuestionIf noIf yesEvidence to look at
1Do several teams need to release parts of the store independently, or does one part need to scale very differently from the rest?Keep a modular monolith and improve its module boundariesGo to question 2Release calendar, merge conflicts, which pages or jobs hit capacity limits first
2Can you provision servers quickly, monitor technical and business signals, and deploy automatically?Build these prerequisites first, while staying on the monolithGo to question 3Time to create a new environment, alerting on errors and on order drops, length of the deployment pipeline
3Is the pressure concentrated in one capability, such as loyalty, search or pricing?Pressure is spread across the store: map capabilities and their data first, extract the one with the clearest boundary and least shared data, then reassessExtract that one capability as a separate service next to the storeWhere change requests and incidents cluster
Microservices readiness: three questions in order Question 1: do several teams need to release parts of the store independently, or does one part need to scale very differently? If no, keep a modular monolith and improve its module boundaries. If yes, question 2: can you provision servers quickly, monitor technical and business signals, and deploy automatically? If no, build these prerequisites first while staying on the monolith. If yes, question 3: is the pressure concentrated in one capability, such as loyalty, search or pricing? If yes, extract that one service next to the store. If no, the pressure is spread across the store: map capabilities and their data first, extract the one with the clearest boundary and least shared data, then reassess. 1. Several teams need independent releases, or one part must scale very differently? 2. Fast provisioning, monitoring of technical and business signals, automated deployment? 3. Is the pressure in one capability (e.g. loyalty, search, pricing)? Keep a modular monolith; fix boundaries Build these first, stay on the monolith Yes: extract that one service next to the store No: map capabilities, extract the clearest one, reassess No No Yes Yes Yes
Microservices readiness: answer three questions in order; only the last two outcomes involve new services.

What Are Microservices?

James Lewis and Martin Fowler describe the microservice architectural style as "an approach to developing a single application as a suite of small services", each running in its own process, communicating through lightweight mechanisms such as an HTTP API, and built around business capabilities. Each service can be deployed and scaled on its own, yet together they serve the overall business objectives.

It is important to stress that many business benefits credited to microservices, like the possibility to test individual application components in isolation and faster application delivery, arise from their API-first nature.

Moreover, microservices are not only a software structure. They also shape an organization's culture: teams become more cross-functional and see how their work affects the product.

What Is the Alternative to Microservices?

To understand why microservices architecture adoption takes shape, let us switch back to its counterpart: monolithic architecture.

Referring to the non-technical definition, a monolith is an object that consists of a single massive material. In software, monolithic architecture builds the application as one piece: all components are developed, deployed and run as a single unit. As Lewis and Fowler note, in a monolith "scaling requires scaling of the entire application rather than parts of it that require greater resource."

A monolith can still be well structured. A modular monolith keeps clear boundaries between modules inside one deployable application, which is often the step that makes a later split possible.

Why Do Microservices Manifest?

The emergence of mobile-first, the shift to omnichannel retail, the availability of technologies aligned with microservices development, and the need for different teams to work on the same store at the same time all triggered building microservices.

Examples from ecommerce projects: separate services, layers and events

Few stores jump straight to dozens of services. In our case pages, the patterns are smaller: a separate service beside the store, a decoupled frontend layer, or event-driven processes:

Micro Frontend: How Does It Relate to Microservices?

When you look through platform build methodologies, you may notice another development trend, which resonates with microservices: micro frontend architecture. While different organizations were mostly focused on addressing monolithic backend limitations, a monolithic frontend codebase brought its own challenges too.

Cam Jackson defines micro frontends as "an architectural style where independently deliverable frontend applications are composed into a greater whole". Similar to microservices, the parts can be developed, tested, and deployed individually, while the customer sees one consistent interface.

Key Benefits of Micro Frontend

The concept of micro frontend has been named after microservices for a reason. The benefits of these two approaches are quite similar. Micro frontend has the following perks for frontend teams and ecommerce businesses.

Sustained upgrades. Micro frontend facilitates case-by-case decisions regarding particular product components, allowing for steady and point architecture upgrades whenever an element requires it. It also makes it possible to test new technologies and interaction modes in a more isolated way.

Cleaner codebase. Unlike a monolithic frontend, micro frontend components have much smaller source code, making it easier to work with a project, make changes, and avoid unwanted coupling of components.

Independent deployment. Each micro frontend can have its own continuous delivery pipeline, so one team can develop, test and deploy without interrupting the other pipelines and codebases. For the pipeline itself, see our article on the DevOps development process.

Operational independence. Not only do codebases of micro frontend architecture operate autonomously, but so do development teams. Every team has full control over the components it works with, which encourages responsibility for end results.

The same article names the costs: independently built JavaScript bundles "can cause duplication of common dependencies", development environments can differ from production, and micro frontends "will inevitably lead to having more stuff to manage". That is why the approach suits large products with several frontend teams and a codebase that keeps growing, rather than a single team's storefront.

The Benefits of Microservices Architecture over Monolithic Architecture

Let us further demonstrate the benefits of microservices by looking at their common characteristics and drawing a parallel between this architectural style and its alternative: monolithic architecture.

Advantages of Microservices

Generally, microservices allow ecommerce companies to design multifunctional and highly scalable ecommerce applications, simplify their testing and frequent deployment, and expedite time to market.

However, potential microservices benefits do not come by default. They depend on accurate microservices implementation in accordance with specific business capabilities and priorities. Microservices methodology in conjunction with a knowledgeable ecommerce development team will present the following business opportunities.

Independent deployment. Smaller codebase and scope enable regular improvements and faster software updates, which, in turn, will let you reap maximum benefits from continuous deployment.

Autonomous scaling. Dealing with software components individually, you are free to remove, add, or scale a separate microservice as required by the business, without the need to scale an entire app. When you scale only the services that need it, you can lower the cost of cloud server resources.

Technology diversity. You are flexible in choosing languages, development frameworks, or data stores for each microservice. Thus, it is possible to experiment with new technologies without committing the whole system to them, and to upgrade one service without tough library versioning issues across the codebase.

Fault-tolerant design. Designed well, the failure of a single microservice does not cause the whole system to crash. Even though dependencies still exist between microservices, timeouts, fallbacks and isolation can keep a failure from cascading throughout the app. This is particularly important for complex systems where failure is not uncommon.

Data isolation. The modular nature of microservices creates a larger attack surface, with more APIs to secure. In return, if each service has its own credentials and its own data store, a compromised service cannot directly read another service's data, which limits the damage and can make it easier to show which components handle regulated data.

Effective cross-team coordination. Any microservices development team must be focused on the lifecycle of a particular service up until it reaches its end consumer. Being fully responsible for the work outcome nourishes a culture of ownership, defining team boundaries and motivating teams to be more productive and inventive.

Monolithic Architecture Drawbacks

For a more comprehensive comparison of the monolith to microservices, we will go over the above points. See the following breakdown.

Difficulties with continuous deployment. Representing a one-piece code where every single element is closely interrelated, monolithic architecture requires redeployment of the entire application at once. This lowers deployment frequency, especially causing problems for UI developers since their work includes frequent deployment.

Poor scalability. Monolithic applications usually scale in one dimension, by duplicating app copies. Separate functions cannot be scaled independently, even though each of them may have different resource requirements.

Technology lock-in. Monolithic architecture also presents obstacles for new technology adoption, and it increases the time and cost needed to change frameworks or languages. Sometimes it even refers to the technology version, which makes you tied to the technology stack you picked from the start. Also, if you upgrade a certain part of the software, it may negatively affect another part.

Limited failure isolation. Since every element runs in the same process and environment, a fault in one component, such as a memory leak, can affect the stability of the whole application.

Security issues. In a big multi-faceted system, a breach in one component can expose the whole application, and a solid multifunctional environment makes it harder to identify which exact component needs to be patched.

Long onboarding for newcomers. Monolithic software can be difficult to understand, and it may take a long time for newcomers to get comfortable with the codebase. Blurry module boundaries also make it harder to assign clear responsibilities. Of course, the bigger a project is, the more complicated this task becomes.

Monolith Is Not Over Yet. What Keeps It Afloat?

The monolith has a bevy of strengths to offer ecommerce businesses, which allows it to remain in demand.

The main advantage of monolithic architecture is infrastructure simplicity. One application means one deployment, one place to debug, and transactions that do not have to span several services and databases. Microservices, by contrast, prefer letting each service manage its own database, so keeping orders, stock and prices consistent across services becomes design work in its own right.

Monolith-first is also a widely held position. Martin Fowler observed that "almost all the successful microservice stories have started with a monolith that got too big and was broken up", and that in almost all the cases he had heard of where a system was built as microservices from scratch, "it has ended up in serious trouble". Even the most skilled developers will not define precise boundaries between microservices from the start.

Monoliths give a good opportunity to evaluate project complexity and decide on the right component boundaries in the process. In our practice, we quite often observe the tendency to start with monolithic applications and, later on, split them into standalone microservices.

When You Should Shift the Focus from Monolithic Systems to Microservices

As ecommerce technologies evolve, some companies are also considering composable commerce, which applies the same idea of independent building blocks to whole commerce capabilities; see composable commerce explained. As experienced ecommerce developers, we contend that everything is relative. Every project has its own ins and outs that must be examined in depth before reaching the final verdict: going to microservices or not.

Switching to microservices development involves the total transformation of the way of thinking, business processes, and tooling.

To make sure your business can manage microservices and reduce the risk of infrastructure overload and unnecessary costs, here are the main questions to ask before adopting this architectural pattern.

What is your corporate culture?

Sociologist Ron Westrum described three types of organizational culture: pathological, bureaucratic, and generative. DORA's research uses his model, and one simple question shows where you are: when someone brings bad news, what happens to the messenger?

In a pathological, power-oriented culture, messengers are punished. In a bureaucratic, rule-oriented culture, messengers are neglected. In a generative, performance-oriented culture, messengers are trained and risks are shared. DORA links this high-trust, generative culture to better software delivery and organizational performance, and it is the culture in which independent service teams work best.

Has your software project been integrated with DevOps processes before?

Mature development and operation practices remain indispensable for companies that consider microservices. Martin Fowler lists three prerequisites: rapid provisioning ("you should be able to fire up a new server in a matter of hours"), basic monitoring, and rapid application deployment to test environments and production. In practice that means a CI/CD pipeline and, often, containers and an orchestrator such as Kubernetes.

Apart from the tools, to derive maximum benefit from microservices it is also important to have a professional DevOps team in place. As an example of that groundwork, for Deutsche Telekom's Croatian subsidiary our DevOps specialists containerised dedicated telecom apps, deployed them on OpenShift and connected CI/CD for teams using different technologies, so that a code change builds a new Docker image and the app deploys on OpenShift (case page).

Read more for further clarification: How to Hire a DevOps Engineer.

Are your monitoring tools robust enough to serve microservices?

A microservices health check is a vital part of overall software performance. You should be well-equipped with effective monitoring tools to gain insight into the operation of each separate component, identify what causes a failure, and prepare a timely recovery for this microservice. Fowler's point applies directly to a store: watch business signals such as a drop in orders, not only errors and availability. See also our overview of monitoring services for ecommerce.

What do you want to achieve with microservices architecture?

Planning to follow the microservices concept, you should analyze your business data, know what changing needs of your customers you want to address, and identify what you will need to level up. Cooperating closely with a reliable team of ecommerce specialists, you can more quickly decide the direction and pace of your business development.

Microservices architecture might be good for you if your organization pursues the following goals:

Name the problem before you name the architecture. When Prostor, an omnichannel drugstore chain with 427+ locations, moved to Magento 2, the case page lists the options that were ruled out: a headless frontend layer over the existing backend was rejected because the urgent problems were peak traffic, CRM/ERP integration and omnichannel, not presentation (case page).

Final Say

Microservices are a mature architectural style, not a default. Monolithic architecture still fits many stores, especially with a single team and a moderate load. The feasibility of microservices migration heavily depends on a given business's demands, as each ecommerce company has a different vision of its value realization, calling for unique solutions. At Dinarys, we focus intently on business individuality and consider the need for migration to microservices within the particular business's potential.

Contact us, and we will plan and modernize your project architecture with the use of microservices best practices, if necessary. Architecture planning relates to the discovery phase of our workflow, where we thoroughly investigate your business, create a product prototype, base documentation, and check your business's readiness for microservices.

You should definitely look into this opportunity if heavy loads or several independent teams are already straining your current system. For composable and service-based architecture work, see our composable architecture consulting.

Lassen Sie Profis Ihre Herausforderung meistern

Unsere zertifizierten Spezialisten finden die optimale Lösung für Ihr Unternehmen.

Bitte einen gültigen Namen eingeben
Bitte geben Sie ein gültiges Unternehmen ein
Bitte geben Sie eine gültige Telefonnummer an
Bitte geben Sie eine gültige E-Mail-Adresse ein
Kurze Botschaft

    Ihre Nachricht wurde erfolgreich verschickt. Wir melden uns in Kürze! Success icon