Develop Magento eCommerce using Microservices

You can create a modern Magento microservice using Node.js and GO or any other your favorite language and framework. It’s very common nowadays. Developers like to use modern stack like PWA, Node js, React, Vue, Go, Rust, Ruby, PHP8 to build an eCommerce website.

The way Magento made money was through complexity and legacy. The more complex the solution is, the more hour$ of customization are required. The more legacy solution is, the fewer developers will like it and learn it, the less competition on the market and developers can’t easily switch the company except another Magento legacy Agency. That’s why more and more companies using their own eCommerce Magento less or hybrid microservices. This solution will be much better than these #Magento “best practices” and Magento Cloud

If you want to build a cool B2B or B2C eCommerce website, be sure you use the latest technology. Unfortunately, Magento2 is a legacy with a lot of bugs and issues. Magento 2 PHP CORE is slow, ORM is outdated, Frontend (XML, Knockout, RequireJS) is like from another planet delivered to our Earth by Reptiloids.

Image for post
Image for post
Magento 2 Node.Js/Rust microservices

A basic eCommerce software just gives the front end of your store that would be obvious on the React client end. Legacy Magento 2 or with better version — Magento 1 will provide information administration, stock administration which are required for any internet stores.

Implementing Magento 1/2 Node JS microservices (Product Page API, Category Page API, Cart Checkout API) gives every functionality required to maintain an internet business.

Magento microservices Ecommerce platforms are created using modern frameworks, for example, LARAVEL, Symfony, ReactPHP, Go, MERN. For your data, MERN stands for MySQL(Magento DB), Express JS, React JS, and Node.js. Good point in Shopify infrastructure that you can write extensions/app on any technologies not limited by MySQL, PHP and JQuery like in Magento.

Node JS and Async I/O works really well with such low-performance DB schema like EAV. Just run a SQL that will return a list of identifiers for your current needs. Then you run N separate simple async non-blocking queries that retrieve data from EAV instead of one 20 miles long SQL Joined query.

Sometimes breaking up a single complex query into multiple simple queries is better.

  1. Simple queries are less likely to be subject to lock contention.
  2. Multiple simple queries can be run across different CPU cores instead of being blocked by a single process. Also, different queries can be run on different replica instances
  3. In earlier days when network speeds were slower, it was better to make only one trip to the database. This isn’t the case nowadays. Network speeds are much faster and using I/O nonblocking languages you are doing queries in parallel without waiting
  4. Parallelism Magento SQL execution is the idea of breaking down a task so that, instead of one process doing all of the work in a query, many processes do part of the work at the same time. An example of this is when 12 processes/CPUs handle 12 different months in a year instead of one process handling all 12 months by itself. The improvement in performance can be quite high.

Notice: Parallel Magento SQL execution helps systems scale in performance by making optimal use of hardware resources. If your system’s CPUs and disk controllers are already heavily loaded, you need to alleviate the system’s load or increase (use Aurora DB for auto scaling ) these hardware resources before using parallel execution to improve performance.

Also, you can replace EAV, filtration, sort, and pagination by NoSQL database like ElasticSearch, Redis Search, however, you could access the rest of the data (Stock, Reviews, Options, Categories) from the MySQL Asyncroniosly/in parallel by identifiers.

Magento CMS platform is really ok for bootstrapping a demo of your project.
But when in need more complexity and good performance, it’s better to build Node JS or Go or Rust microservices or even monolithic applications.

You can’t go with Legacy technologies like PHP Magento 2. Magento can do a good job at the beginning and for small businesses. Also, Magento 2 PHP hosting needs a lot of resources and will cost a lot of dead pre$ident$. However, moving forward, with an increase in end-users and traffic to the platform, which is usually expected in enterprise-level eCommerce, Magento based eCommerce solutions will not be suitable.

NodeJS Magento microservices is a very good technology with several advantages like:

  • Runs on V8 Engine that is owned by Google
  • Non-block I/O and asynchronous request handling that ensures speed and performance. Works well even with the legacy Magento EAV DB database.
  • An event-based model with a common language for both Server/Client side.
  • Highly scalable technology
  • Supports microservices serverless Lambda architecture
  • Node JS can utilize cheaper ARM CPU based instances/hosting without performance degradation
  • Highly compatible with automatic deployment
  • Works Fast even without legacy Varnish

So ideally, an enterprise eCommerce platform, built on Magento NodeJS, etc can have advantages.

Reaction Commerce and Spurtcommerce are the two NodeJS eCommerce platforms that are open source and come with 100 percent access to full source code.

Learning Functional Programming with JavaScript

Written by

Magento/APP Cloud Architect. Melting metal server infrastructure into cloud solutions.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store