Presentation made by
Mark Brinton - Product Owner of MSI
Igor Miniailo - Architect of MSI
who described the story, product backlog, architecture and community contribution on the Multi-Source Inventory project
3. Mark Brinton
Sr. Manager, Product | Magento Commerce
@markabrinton
Igor Miniailo
Software Engineer | Magento Commerce
@iminyaylo
4. Where did we start?
West
Central
East
Requests from
merchants and
partners
• Need Multiple
warehouses
• Can’t split
inventory for a
single product
Current state
• Single stock only
• Must customize or
extend
• Can be complex to
manage and
upgrade
Multiple types
needed
• Warehouses
• Stores
• Distribution
Centers
• Drop Shipping
Increasingly
common
• Even for smaller
merchants
• Applies to both
B2C and B2B
6. Validating the request
High interest and
common need
• Not an edge case
• Multiple validation signs
• B2C and B2B
• SMB and Enterprise
Suitable for core
development
• Impacts many modules
or areas of core
• Key part of the order
process or checkout
• Complex to customize
properly
Base for extension
• Drive standard approach
• Natural extension points
• Creates marketplace
opportunity
Top 3 in partner voting
Most commented issue
on GitHub
Top 5 on Magento
Forums
Many merchant types
and sizes
Inventory is complex
and benefits from a
consistent architecture
Impacts checkout,
shipment, returns, etc.
API integrations
common for inventory
Source Selection
algorithm logical to
customize
7. Let’s get started!
• Originally an internal project
• First requirements documented in September 2013
• Assigned to Dragons team
• Went through multiple name changes:
– Multiple Warehouse / Node / Source Inventory
• Final naming decision: Multi-Source Inventory
– Source is the most flexible name to handle multiple location types
– Consistent with naming approach used in Magento Order
Management
8. Original internal Epic MAGETWO-14308
Progress!
Source management
Assign products and
quantity to sources
Priority-based selection
algorithm for shipment
9. Software development is difficult
• Didn’t complete all stories for the feature
• With only one team assigned, velocity was not as high as we
needed to maintain pace
• Inventory is complex, with partial or incremental release
challenging
– Touches many areas of the core and multiple modules
– All aspects of merchant inventory process must be supported, from
purchasing to orders and through to shipment and returns
• Internal constraints on breaking changes while making major
changes to inventory created technical debt
• Other projects took higher priority
10. So, now what?
• Market research has not changed – the feature is still important
• How can we continue without internal teams assigned?
• Convenient timing
– Community Engineering Team created in February 2017
– Wanted to expand engagement with the community
– Interest from community members
– Have a documented feature ready, with some work completed (we
ended up starting from the beginning)
11. The community development model
Benefits for Magento
Improved velocity for new features
Localized expertise for inventory
management differences by market
Direct client perspective
More reviewers = faster to find bugs
Get feedback while building the
feature, not after release
Project Goals
Showcase the depth and talent of
community engineers
Improve our working process for
complex features with remote
developers
Increase developer engagement with
Magento
Reduce time to build without utilizing
full team of internal developers
12. But how can we recruit developers?
• All contributors will be volunteers
• Can’t assign work to anyone, they
must offer to help
• Need to make the opportunity
compelling for participants
• So, how to start?
– Join an existing community event
to build momentum for the project
14. What did we offer to participants?
• Partner with our developers and architects
• Learn Magento best practices
• Get listed as a contributor in release notes
• Intellectual challenge of a complex feature
• Chance to collaborate with other developers
and build community relationships
• Strengthen reputation with merchants
• A faster release of MSI for clients
• No more customizing inventory for clients
• Opportunity to give back to the community
Igor Miniailo@RicTempesta
19. Remote project management process
• Started with
– Familiar to developers
– Avoided difficult process of granting
access to Magento JIRA instance
• Multiple features
– Code and source control
– Wiki for documentation
– Individual issue tracking
– Comments and collaboration
– Pull Requests for contributions
• Initially tracked stories in a wiki table
20. MSI Community: GitHub
Our Community
Engineering GitHub
repository contains all
code for the project and is
used to manage pull
requests, assign stories,
and track issues. Any
developer can see how
the project has developed
over time and submit pull
requests for review.
github.com/magento-engcom/msi/
21. MSI Community: Wiki
Our Community
Engineering wiki contains
documentation for the
project, including
technical vision,
architecture, definition for
each story, UX, and
roadmap. This enables
new developers to quickly
understand the project
and participate.
github.com/magento-engcom/msi/wiki
22. MSI Community: Slack
Our Community
Engineering Slack has
specific channels for MSI
questions and discussion.
Developers can get help
with the project and
collaborate together,
regardless of time zone.
magentocommeng.slack.com
23. Meet Magento Germany
Leipzig, Germany
Meet Magento Sweden
Stockholm, Sweden
Magento Live UK
London, United Kingdom
Mage Unconference
Utrecht, Netherlands
Magento Hackathon
Munich, Germany
Meet Magento Romania
Cluj, Romania
Meet Magento New York
New York City, USA
Mage Titans Austin
Austin, USA
MSI Contribution Week
Kolbermoor, Germany
Meet Magento Spain
Madrid, Spain
Mage Test Fest
Amersfoort, Netherlands
Atwix Contribution Day
Khmelnytskyi, Ukraine
Mage Titans Manchester
Manchester, United Kingdom
Amasty Contribution Day
Minsk, Belarus
Mage Conf Kiev
Kiev, Ukraine
2017 MSI Community Events
24. More contributors = more complexity
• As more contributors joined the project, it
became difficult to manage on the wiki
– Many additional stories created
– Issues manually linked together
– Not possible to report on stories
– Prioritization is not easily available
• Also, it was not clear where someone new
to the project could start participating
25. MSI Community: ZenHub
• Enter Zenhub
(demonstrate) – list
the specific benefits –
prioritzation, stages,
epics and stories,
estimations in a
single easily updated
place, reporting. Also
given this for free
because this was an
open source project!
We reached an
agreement with them
github.com/magento-engcom/msi/
26. Zenhub Benefits
• Track individual stories
• Create Epics and relate stories
• Assign tasks
• Prioritize work
• Track estimations
• Report on progress
27. MSI Community: Weekly Demo
Demos are held for the MSI
project every week on
Friday using Zoom. Any
developer can attend the
demo to see what is
happening on the project.
All demos are recorded and
posted on YouTube.
bit.ly/MSIdemo
28. MSI Community: Standup and Grooming
Daily standup and recurring
grooming meetings are
optional for contributors. In
these meetings we discuss
issues in more detail and
plan stories.
All meetings are conducted
using Zoom to include
remote attendees.
29. Testing MSI using MFTF*
• 1st Community Extension to utilize MFTF
• Results to date:
– Discovered gaps in MFTF which are being addressed
– Finalized the location of Test Folders for Modules:
– Discovered gaps in our Jenkins/Bamboo builds which
are also being addressed
– Created Multiple automated tests (30+)
– Discovered several MSI bugs from the tests we created
*Magento Functional Testing Framework
Old: dev/tests/acceptance/tests/functional/Magento/FunctionalTest/[Module]/Test
New: /app/code/Magento/[Module]/Test/Acceptance
30. Architect Product Manager UX Designer
QA Lead Tech Writer Community Engineers
How we supported the MSI project
32. Merchant Benefits of MSI
• Manage multiple-location inventory from the admin
– Familiar interface where they already manage orders, catalog, etc.
• Assign products to sources and manage quantity in each source
• Create Stocks to define sources eligible to deliver for each website
• Control how warehouses are selected/assigned for delivery based on
merchant preferences
– Initial: simple priority algorithm (MVP)
– Later: lowest cost algorithm by distance proxy
• Manually control shipment Sources when override is necessary
• API coverage for integration with 3rd party inventory systems,
warehouses, or custom inventory actions
• Inventory reservations for performant checkout and accurate quantity
available for sale
34. Technical Overview
• MSI is a brand new way to handle inventory
– Event Sourcing + CQRS architecture
– Scalable Multi-Dimensional indexes for Stocks
– Usage of PHP 7.1 features
– Highly modular design
35. Technical Overview
• MSI is a brand new way to handle inventory
– MSI is much more than just an extension, but a new way to handle
inventory and reservations for all merchants
– These changes will become part of core in 2.4
– Not just for merchants with >1 source
36. Size of MSI Project
• 25 modules created in the scope of the project
37. Inventory Reservations in MSI
• When an order is placed, a reservation is
made to ensure there will be enough
quantity available to fulfill the order
• Reservations are append only operations
to prevent blocking operations and race
conditions at checkout
• The reservations table is periodically
cleaned of reservations that sum to zero
Merchant Benefits
Performant checkout even with high concurrent sessions
Prevents overselling available inventory
38. Reservation Example – Step 1
France Warehouse
SKU-1: 5 qty
EU Stock
SKU-1: 15 qty
Italy Warehouse
SKU-1: 10 qty
Raw data Index Reservations
Salable Qty: 15 (data from index, empty reservations)
40. Reservation Example – Step 3
France Warehouse
SKU-1: 5 qty
EU Stock
SKU-1: 15 qty
Italy Warehouse
SKU-1: 10 qty
Raw data Index Reservations
Salable Qty: 10 (data from index: 15, apply all reservations: -5)
Data is NOT changed
SKU-1: -5 Order #001
Reservation has been added
41. Reservation Example – Step 4
Actions: From the original order of 5 products, 3 are returned
42. Reservation Example – Step 5
France Warehouse
SKU-1: 5 qty
EU Stock
SKU-1: 15 qty
Italy Warehouse
SKU-1: 10 qty
Raw data Index Reservations
Salable Qty: 13 (data from index: 15, apply all reservations: -5+3)
Data is NOT changed Reservation has been added
SKU-1: -5
SKU-1: +3
Order #001
Return #001
43. Reservation Example – Step 6
Actions:
• Admin ships remaining items in order (qty 2)
• Reindex on shipment of order
44. Reservation Example – Step 7
France Warehouse
SKU-1: 3 qty
EU Stock
SKU-1: 13 qty
Italy Warehouse
SKU-1: 10 qty
Raw data Index Reservations
Salable Qty: 13 (data from index: 13, apply all reservations: -5+3+2=0)
Data is CHANGED
SKU-1: -5
SKU-1: +3
SKU-1: +2
Order #001
Return #001
Order #001 Shipment
Reservation has been added
45. Reservation_id Stock_id sku quantity metadata
1 2 SKU-1 -5.000 order_placed:order:1
2 2 SKU-1 3.000 order_cancelled:order:1
3 2 SKU-1 2.000 shipment_created:order:1
Reservation Example – Step 8
Action:
• Reservation cleaning
• Looping through these reservations we can find reservations
which in sum return 0 (Zero) and remove them
46. Reservation Example – Step 9 (like Step 1)
France Warehouse
SKU-1: 3 qty
EU Stock
SKU-1: 13 qty
Italy Warehouse
SKU-1: 10 qty
Raw data Index Reservations
Salable Qty: 13 (data from index, empty reservations table)
Data is NOT changed Reservations have been
removed
47. Extension points and APIs in MSI
• For integration with ERP and PIM systems
– Inventory Sales API (Reservations placement)
• For extension developers
– Source Selection Algorithm APIs to provide own more efficient and
business oriented choice of Sources for order fulfillment
50. Project Challenges
Challenge Mitigation Strategies
Attracting developers Help developers get started at in-person events
Offer incentives (complexity, recognition, collaboration)
Retaining developers Groom stories into multiple sizes (S, M, L) to match
developer availability
Provide detailed feedback and code review
Time zones and
different working hours
Slack channels to answer questions in real time, even
when Magento team participants are offline
Remote contributors Software tools: Zoom, YouTube, Slack, GitHub
Distributed contribution day for virtual participation
Estimating velocity
(most difficult)
Rough sizing based on events and attendees
Regular estimates from consistent participants
(only works in the short term)
51. Lessons Learned
• Project management methods
need to change with
contributors and complexity
• Experiment with different tools
• Start new participants at
events, then encourage regular
contributions
• Use voting to quickly refine
priority and approach questions
• Demos show progress, build momentum, and help newcomers
• Define features partially and take community input
52. What’s next for Community Projects
• Significant investment in Community Engineering
• Coming soon: partner internal development teams with
community contributors on core features
+
Austin, Texas
3
Kyiv, Ukraine
6
Frankfurt, Germany
1
53. Try it out!
• MSI development code
is already available
• Clone on GitHub and
follow our progress
github.com/magento-engcom/msi/wiki
54. Become a Contributor
• Want to help with MSI or another community project?
– Email Community Engineering to get started
– Not an engineer? You can also contribute to documentation!
– Other projects
• Bulk API
• Import / Export enhancements
• PHP 7.2 Compatibility
• And more!
engcom@magento.com
Hello everyone, and thank you for joining us today. My name is Mark Brinton. I’m the product manager at Magento responsible for the Multisource inventory project. I’m also joined today by Igor Miniailo, the architect for this feature. In today’s session, we will cover the story of the project and how we’ve worked with the community. Igor will also share details on some interesting technical aspects of what we have built.
But first, a little background. This project initially started because we heard many requests from merchants and partners asking for multi warehouse support in Magento. They told us we need multiple warehouses…
As a product manager, I like to summarize what we plan to build from the user’s perspective, which in this case is the merchant.
*READ CARD*
*click*
I also like to imagine what the merchant will feel like when they have this capability
Once we get any request for a feature from our users, we go through a standard validation process. We’re looking for a few key points. First, is there high interest in the feature, and is it something many merchants would benefit from? We want to make sure the request is not for an edge case scenario. To do that, we look for multiple validation signs. Does this appeal to both B2C and B2B merchants? …
With validation of the request complete, we moved to start building the feature.
And we made some progress. Here’s a screenshot of one of the original designs. We completed several important stories, including the ability to manage sources in the admin panel and assigning products and quantity to sources. We also built a priority-based selection algorithm for shipments.
However, we ran into some challenges at that point. We weren’t able to complete all the stories to release the feature.
At this point we were at a decision point. We knew the feature was important. Our market research showed merchants wanted it, but we didn’t have any internal teams available to assign to continue work. Fortunately for us however, this happened right around the time we created our Community Engineering Team…
Using community developers has several benefits for Magento
But, we still have the challenge of recruiting contributors for the project!
We started the project at a hackathon last May, just before Meet Magento Germany
But this isn’t just about how we as Magento benefit from community contributions. We worked hard to offer a compelling opportunity to participants. They had the chance to… Riccardo Tempesta at Mage Titans Italy
And of course, we kept the developers well fed in the process, which is always important. Special thanks to our sponsors on the slide here who helped out with this event.
So what happened at the hackathon? As is common for these events, we had to pitch our project against many other ideas. The good news is Multisource inventory received the most votes. I was very glad at this point, because I didn’t want to travel all the way to Leipzig and fail to recruit volunteers!
We accepted our first pull requests for the project at the event. As you can see from the slide here, we also recognized those contributors in a keynote presentation at the conference.
However, all events must come to and end. We had a great start to the project, but the real work of maintaining momentum started after we flew back to the office.
When you are in the same location, it’s easy to answer questions and discuss the best way to solve problems. But how would we do this remotely?
To manage the project remotely, we started with GitHub
Here's what it looks like. In our GitHub repository, users can always download the latest MSI code...
GitHub also has a wiki where we store project information.
We also created some channels on our Community Engineering Slack to allow for collaboration...
** preview of next slide **
Now with this basic framework in place, we needed to expand the number of contributors working on the project. Because a kickoff event had been so successful for us, we decided to double down on events and join as many as possible. Max, who runs the Community Engineering team, definitely earned a lot of frequent flyer miles to move things forward at this point
Here’s a list of events where we had MSI contributions in 2017 alone. We have continued this momentum in 2018.
The good news was we had more people contributing to the project. We were also successful in getting people who started contributing at an event to continue on the project after they returned home, with many working nights and weekends on contributions. This was good, but also introduced challenges
To solve this problem we looked for solutions that could improve what we were already doing on GitHub to manage the project. After some research we discovered ZenHub. ZenHub allows us to follow stories through from design to completion
There are also some other great benefits to ZenHub. Using ZenHub, we can
Another important thing we added was a weekly demo for the project. This allowed us to showcase the work that was being done, give individual developers the chance to be proud of their contributions, and help newcomers onboard to the project
We also added some additional meetings: a daily standup and regular grooming sessions.
Of course it's important to have high quality on any new feature we include in Magento. And MSI is the first community extension that uses the Magento Functional Testing Framework. We also develop test scenarios in a tool called Hiptest, which helps with automation. So far using this approach we also improved MFTF itself. We discovered several gaps in MFTF which are being addressed. We also....
To make the project successful, we also supported it with dedicated resources across several disciplines
I’m excited to announce the contributions for this project have exceeded our expectations. Overall, we’ve had contributions from 66 separate community members
All these contributions have created some great benefits for merchants. With MSI, merchants will be able to manage multiple location inventory from the admin panel.
And now I’ll turn it over to Igor, who will cover some of the interesting technical aspects of the MSI project
Add screenshot of cart here – make sure to use SKU-1 in screenshot
Add screenshot?
And now I’ll turn it back over to Mark, who will review some key learnings from the project
Of course the MSI project, like any project, hasn't been without challenges. Here are some of the main ones we encountered and how we tried to mitigate them. First, the challenge of attracting developers...
With the goal of continuous improvement, here are some of the lessons we have learned so far working on MSI. First, project management methods need to change as the number of contributors and the complexity of the project increases....
In the past year, we’ve made a significant investment in our Community Engineering effort. The team is now 10 people total, with 3 in our Austin office, 6 in Kiev, and one in Frankfurt Germany.
Because this is a community project, all our work is available on GitHub. Please download the code and try it out! You can follow the project progress as we go
And of course, we are always looking to welcome new contributors. If you'd like to contribute to MSI or any other community engineering project, send an email to engcom@magento.com
Q&A – for both product and architect
*We can answer both business and technical questions*