Benefit of moving from Magento 1 CE to Magento 2 CE / Indexers / ERP sync
In this post we will explain what are benefits and why to move form Magento 1 community edition to Magento 2 community edition. It’s very important for merchants which have some ERP system or have some integration between Magento and some other core system in their business.
If you have web shop on Magento 1 CE then you probably had issues with indexers, stock status, price data and so on. Also you had issue with product save in Magento admin. In the end it’s resulted decreasing conversion rate, your site is often unavailable, customers can’t place order. It is nightmare for every merchant.
One of the big benefit in Magento 2 CE are indexers.
First we have to explain how indexers works in Magento 1. Indexers have two modes: manual update or update on save.
Update on save is default value and indexers are triggered on every product save or category save. It means that when you place order or save product in Magento admin then re-index will be occurred. It is synchronized operation and it will have influence on time needed for product save or place order. In that case time for product save will be more than 1 second. Also load on mysql server will be occurred and some records in database will be locked. In the end it can couse mysql deadlock and transaction rollback. Some orders will not be placed.
It’s especially problem when you have bit traffic on site, a lot of orders in the small time interval or you have to update big amount of products over api and re-save product in that case you site will be overloaded or unusable for all consumers.
Solution for this is implemented in Magento 2 CE. There is new option on indexers: Update by Schedule, it means that affected products will be re indexed by cron in background by separated process.
Then product save will not be slowed and place order will not have to wait for reindex product stock and price. Also your erp can update more products in the same time.
I made some experiments and I can confirm that I updated four products in one second, what is four times festers then Magento 1.
How it looks in background in Magento 2?
If you dig in code and database you will notice that Magento 2 implemented mysql triggers and separate cron for processing.
First of all you should set indexer in mode Update by Schedule. After that if you go to phpmyadmin you can see triggers with command:
You will see something like on image below:
Thanks for reading and I hope that you understand benefit on improved indexer logic. The same logic is already used in Magento 1 but only in Enterprise Edition. I have good experience with implementation on this way.