Presentation is loading. Please wait.

Presentation is loading. Please wait.

Multi-Source Inventory CQRS and Event Sourcing in Magento 2

Similar presentations


Presentation on theme: "Multi-Source Inventory CQRS and Event Sourcing in Magento 2"— Presentation transcript:

1 Multi-Source Inventory CQRS and Event Sourcing in Magento 2

2 Valeriy Nayda Magento Developer, Multi Source Inventory
Community Engineering Team

3 Community Engineering Team
Main goal is to build a bridge between Magento Core and Community GitHub activities: working with Pull requests and Issues Working with our solution partners (rewards programs and so on) Special Development

4 Multi-Source Inventory (MSI)
MSI is designed to enable stock management in multiple locations so that merchants can properly reflect their physical warehouses in Magento system without external extensions or customization

5 Split the inventory between the sources within one Magento installation

6 MSI Architecture

7 Base concepts

8 Source > Stock > Sales Channels relation

9 Replace current Inventory with MSI

10 Checkout Action Points/Goals
Unload the process of placing an order as much as possible Remove unnecessary locks (get rid of race condition between concurrent transactions) Improve the scalability of the checkout (shipping algorithms)

11 Command/Query Responsibility Segregation (CQRS)

12 CQRS EAV and Flat tables

13 CQRS in MSI

14 Quantity Calculation during Checkout

15 Reservation mechanism
Reservation - the entity is used when the order is placed and we need to reserve some product quantity in stock. Reservations are append only operations and help us to prevent blocking operations and race conditions at the time of checkout.

16 Order Placement – Step 1 Raw data Index Reservations No records
France Warehouse SKU-1: 5qty EU Stock SKU-1: 15qty No records Italy Warehouse SKU-1: 10qty Available Qty: 15qty (data from index, empty reservations)

17 Order Placement – Step 2 Action: Customer buys 5 products on frontend

18 Order Placement – Step 3 Raw data Index Reservations
Data is NOT changed Reservation has been added France Warehouse SKU-1: 5qty EU Stock SKU-1: 15qty SKU-1: -5 Italy Warehouse SKU-1: 10qty Available Qty: 10qty (data from index 15, apply reservations -5)

19 Order Placement – Step 4 Action: Admin cancels 3 products from 5

20 Order Placement – Step 5 Raw data Index Reservations
Data is NOT changed Reservation has been added France Warehouse SKU-1: 5qty EU Stock SKU-1: 15qty SKU-1: -5 SKU-1: +3 Italy Warehouse SKU-1: 10qty Available Qty: 13qty (data from index 15, apply reservations -5+3)

21 Order Placement – Step 6 Action: Admin completes order. Re-index was run.

22 Order Placement – Step 7 Raw data Index Reservations Data is CHANGED
Reservation has been added France Warehouse SKU-1: 3qty SKU-1: -5 SKU-1: +3 SKU-1: +2 EU Stock SKU-1: 13qty Italy Warehouse SKU-1: 10qty Available Qty: 13qty (data from index 13, apply reservations =0)

23 Order Placement – Step 8 Action: Reservation cleaning Looping through these reservations we could find reservations which in sum gives 0 (Zero) and remove them.

24 Order Placement – Step 9 (like Step 1)
Raw data Index Reservations Data is NOT changed Reservation has been removed France Warehouse SKU-1: 3qty EU Stock SKU-1: 13qty No records Italy Warehouse SKU-1: 10qty Available Qty: 13qty (data from index, empty reservations)

25 More information on Wiki page
New Indexer for Stock Items Reservations

26 Community Collaboration

27 Kanban board and Wiki are on the GitHub
.

28 Slack Channel to Exchange ideas (#MSI)

29 Special Development In Special development direction we have started to work with Community Benefit for Magento is creating new important feature Benefit for Community is increasing knowledge about Magento 2 Provide a set of best practices how to work with Magento 2 (some cookbook)

30 Related Links Documentation https://github.com/magento-engcom/msi/wiki
Roadmap Dashboard Weekly Demos

31 engcom@magento.com @_naydav
Thank y’all! How to join us? Send an to @_naydav


Download ppt "Multi-Source Inventory CQRS and Event Sourcing in Magento 2"

Similar presentations


Ads by Google