Anthony, Andreas, Rouven, Allistair, Vinai, Matthias
Important: this code is a proof of concept and in no way meant to be used in production!
You can scale Magento in many ways but there is one bottleneck which won't go away: the checkout process. When an order is placed, Magento does a lot of work in the background. This poses a problem for high volume stores.
This extension (part of the Magento Hackathon Munich in March 2012) uses a MongoDB database to solve the issue. The basic idea is to not create the orders directly on checkout but to push the order creation task to a queue which is processed by a cron job. The customer gets the confirmation as soon as the data data is written to the queue which should speed up the checkout quite a bit.
To make this possible, the following aspects have to be considered and implemented:
- save the quotes information in MongoDB and keep it up-to-date whenever the customer changes his cart.
- check if there are enough articles in stock when a user adds product to the cart.
- after the checkout, transform the quote to an order in MongoDB, create a job to insert the orders into the Magento database
- remove old entries (completed jobs etc.) in the MongoDB database periodically.
- Magento uses the order as a foreign key in several flat tables and the order addresses. Therefore the creation of this entries has to be pushed to the queue as well.
- MongoDB. Obviously. Find out how to install it in the MongoDB documentation.
- MongoDB PHP driver. This is a PECL extension. Check the installation guide.
- Fix Mage_Checkout_Model_Type_Multishipping::createOrders() It doesn't use sales/service_quote::submitAll() or sales/service_quote::submitOrder()
- Update MongoDB when user logs in (quote data is not updated correctly when you add products as guest and then log in?)