The world’s first version of Magento 2.3 Commerce + MSI works in production and even more: it is fast and stable.

Bartłomiej Szymański
Strix
Published in
7 min readNov 28, 2018

Learn all about implementation, challenges, new features in version 2.3, and about MSI (Multi-Source Inventory)-the only functionality written entirely by the Magento community.

Decision to install version Magento 2.3, before the official release. Why? For what purpose? And how did we do it?

During project implementation we were tasked with upgrading Magento from version 2.0.1 to 2.2.6. Previous analysis showed that several additional modules are used to manage sales and multiple warehouses and their stocks. As contributor in Magento MSI project (Multi-Store Inventory) I knew exactly, what possibilities are provided in native software in version 2.3. It became obvious that stock management is one of the most signifitiant functionalities. As a company, we faced the possibility of installing version 2.3 Commerce with MSI, before the official release, which would naturally fit perfectly into the business characteristics of our project. Although the risk linked to the production implementation of the version that was considered to be unstable, constantly evolving, was high, we took up the challenge. For the team, this meant necessary and frequent code updating and keeping key business functionalities unchanged, including the most important — the path to purchase. In the early alpha version, it turned out that the aforesaid purchase path was working as intended, also, we didn’t find and critical errors.

At the very beginning of the project, most of the work was related to establishing and programming the appropriate logic of many imports — users, products, prices and stocks . All communication was created using native REST API Magento interfaces. The only modification was building a proper API foundations to keep query construction unchanged. It was important from the business point of view, so that the integration was not changed when compared to the already existing solution. We were the first to be able to check the new ASYNC API functionality, i.e. asynchronous processing of large amounts of data by the Magento API, using Rabbit MQ queues. Everything seemed to work fine, but in a later stage of the project using asynchronization in APIs turned out to be redundant, because message queuing was moved to the client’s website.

Multi-Source Inventory (MSI)

Let me introduce MSI- multi-storey management module, one of the most expected functionalities in Magento 2.3

MSI allows you to:

  • create sources in specific locations (such as warehouses and shop windows),
  • stock creation, stock aggregation,
  • linking warehouses to sales channels, prioritization of sources,
  • source matching algorithm for shipments
  • shipment (picking) of shipments from multiple locations,
  • monitoring, stock updates by source,
  • notifications of low available/saleable stock warehouse, shortages in the warehouse,
  • algorithm extensions for own sources,
  • integration with external systems via MSI APIs.

MSI in Magento 2.3

The use of MSI in the project turned out to be a very good decision. From the Magento side we received preexisting solution that described the business logic of the client perfectly. We started our work by migrating existing warehouses and defining appropriate sales channels. Finally, almost 80 warehouses were defined in Magento, aggregated in three websites. A special business feature is that 2 “website” use the same warehouses. In the previous solution a special module responsible only for this logic was written. And here MSI offers the solution “out of the box”, we simply specified in which “website” is used for the appropriate magazine — simple.

Then we faced the difficult moment in the project. We had to adapt the MSI code to the business needs as the logic of calculating the product availability for sale turned out to be completely different from the native implementation. In our case, instead of counting the total number of items in stock, we had to implement a more complex process. One of the warehouses had to be defined as the main one in the appropriate sales channel and each product becomes available if the main warehouse has 1 or more pieces or in other warehouses the sum of pieces is greater than the set quantity. And at this point, thanks to the fact that the MSI code is written in a modern way with appropriate separation and responsibility of individual classes, the “substitution” of our functionality instead of the default one turned out to be very simple and intuitive. From the developer’s point of view, working with MSI code is a pleasure.

Another challenge was to add support for multiple warehouses for bundle products, which in the first version of MSI will use the “old” warehouse management system in Magento. We treated the creation of this solution as an integration of necessary functionalities ensuring proper handling of business processes. The applied solution cannot be treated as a fully-fledged handling of “bundle” products, but undoubtedly in this respect we can boast of already gained experience.

Declarative DB Schema

In my opinion, just after MSI, one of the most expected functionalities is declarative db schema. The previous way of declaring database schema in Magento could grow out of control with enormous classes, causing developer consternation.

Since version 2.3 it has changed completely. Finally, the developer has easy and pleasant way to determine how the database schema should look like. All modifications take place in XML file responsible for the definition of DB structures and their relations in the database. Moreover, the approach in the future will undoubtedly help to create a mechanism to rollback the changes. At this point I must also mention that I had the opportunity to check the operation of the tool for generating xml files describing tables based on the previously used installation scripts — it works very well without the slightest problems.

Modules

How does Magento 2.3 work with modules that already exist on the market? It varies from one module to another. I have had the opportunity to install about 20 different extensions. More or less half of them were not a problem despite significant changes in the code, it turned out that they were compatible and worked without any problems.

In the second half, minor modifications were necessary to adapt the functionality to the Magento 2.3 version. It is obvious that the vendors have not yet managed to properly modify the extension code to a version that has not yet been officially released, so we were prepared for this eventuality.

Maintaining the development version

The biggest challenge turned out to be keeping the development version in the unchanged and fixed state. During our development work we based on the code, which was constantly changing over time. Very often it turned out that what we managed to fix or adjust while working with the application was repaired or changed in the next version. In retrospect it was a very unique experience. Of course, also in this case we knew earlier that such situations would occur. During 3 months of work in the Magento core was updated more than 20 times!

We have version 2.3 in production

Finally, during the night of November 5–6, 2018, the application code was implemented on production, all the traffic redirected to new servers and version of the application in version 2.3.0-beta32 Commerce with MSI 1.0.0-rc began to handle the store.

Success! The world’s first version of Magento 2.3 working in production, what’s more — it works very stable and very fast.

In the current phase of the week after the release it is hard to point out specific comparisons to version 2.2.x, however looking at the charts seems to be faster, much faster. Finally, the advantages of PHP version 7.2 can be used in Magento.

Comparing key transactions based on the application based on Magento 2.2.6 version in a similar configuration can be pointed out:

1. displaying the category page-2 x faster

2. displaying the product page-1.5 times faster

3. checkout-very similar times with a slight advantage for 2.3

4. cms pages-1 x faster

Of course, it is difficult to indicate a specific comparison of data from two different applications, objectively the feeling of browsing seems to be much faster.

Tools monitoring the use of PHP on servers undoubtedly point to a double benefit for Magento 2.3.

Summary

From my experience I can say with all conviction that the changes introduced in Magento 2.3, led by MSI, are a step in the right direction. Stability, speed, reliability indicate that this is a very successful version of Magento, bringing many new improvements.

--

--

Bartłomiej Szymański
Strix
Writer for

Head of Software Development in Strix, certified Magento developer, top contributor in the MSI, winner of Magento Community Spirit Awards 2018.