I’m rebuilding an aging node online store with a mongo backend into an Elixir project with Postgres for the data layer. Since I can’t do anything the easy way, I’ve also decided to eschew my own patterns and use Ash to manage the framework stuff. NGL, I have been seduced by Ash conceptually, and I’m going to put it to the test with my company’s main means of making money.
One of the core problems of an online store that sells physical product is making sure you’re tracking that physical product accurately. We have multiple inventory locations that service different parts of the world. As such, these different warehouses have different quantities, constraints on amounts, buffers for oversell, that sort of thing.
I’ve been doing my research and have found what appears to be a reasonably robust inventory accounting method that can track all the stuff I need to track, lock availability when things are added to carts, the works.
I also don’t want to reinvent the wheel. I’m looking at the available extensions for Ash that are already out there, and I’m not seeing anything that really fits the bill. I could maybe make the Double Entry Accounting extension bend to my will, but I’m not super stoked about trying that angle. Do the seasoned Ash developers on the forum know of any off-the-shelf inventory systems?
2 Likes
Nice project that you are welcome on, I don’t think that there is an off the shelf inventory management extension for Ash or even elixir at large. However a simple suggestion that can perhaps improve your custom implementation, why don’t you consider building your system as a CQRS/ES with ash_commanded extension and use Reactor for orchestration.
Thanks! I’ll investigate.
Hey @wallyfoo,
While it’s not off-the-shelf – and perhaps too domain-specific for your use-case – maybe you’d want to check out this repo:
1 Like
This is only tangentially related but I came across this blog post recently which is about using double-entry accounting for inventory management. Specifically using the Tigerbeetle database (which implements double-entry accounting) to manage ticket sales. Maybe you’ll find it interesting 
1 Like
Very cool. Maybe double entry isn’t as wild an idea as I thought.
1 Like
Reading more about Reactor, their “advanced workflow” example is exactly an order processing system.
1 Like
In that particular case I don’t think it’s so much double-entry as it is that Tigerbeetle is a database designed for very high-contention workloads which both financial transactions and ticket sales/product inventory tend to be. With transactions you have hot accounts, and with inventory you have hot products. And in both cases strong consistency is an absolute necessity.
I’m not saying double-entry is a good or bad idea here; I don’t really know enough about it. It certainly seems to be an enduring paradigm, though!