Having built similar software, at a smaller scale, I think you're massively overestimating the complexity of shopify.
At it's core, what they provide is (largely) read only set of products, and a (largely) append only set of purchases.
The only write operation that needs to lock the database is when you adjust the quantity of available inventory. You need to pay attention and think things through to do that with good performance, but it's not that complex. and they wouldn't be doing millions of sales per second.