HN Gopher Feed (2017-06-26) - page 1 of 10
Inventory management in MongoDB: A design philosophy I find
15 points by douchehttps://ayende.com/blog/178785/inventory-management-in-mongodb-a...
bsg75 - 56 minutes ago
Did I read that right? A document per item in inventory? This seems
lilbobbytables - 10 minutes ago
As someone not versed in Mongo or anything similar, what is the
alternative? A large array of docs that has to be loaded in to
memory to work with?
pjungwir - 3 minutes ago
From the article: > The example is that if you have 10 rakes
in the stores, > you can only sell 10 rakes. The approach
that is taken > is quite nice, by simulating the notion of
having a > document per each of the rakes in the store and
allowing > users to place them in their cart. In other
words there are 10 documents in Mongo, not 1 document with a
`"quantity": 10` attribute.
mrlinx - 8 minutes ago
What else would you suggest?
valarauca1 - 14 minutes ago
TLDR:Using a database that doesn't offer ACID, in a manner that
requires ACID has non-trivial associated costs. This may also leave
you open to a number of strange situations, where inventory
quantities are unknown or incorrect.
moxious - 10 minutes ago
New families of DB technologies generally traded certain things off
(like ACID guarantees and transactions) in exchange for other
things like scalability or flexibility. When someone comes back,
and in user space reimplements the things that the DB intentionally
traded off, you get the worst of all worlds. It's quite a bit like
flattening one end of a screwdriver so that you can make it work to
drive nails. Yes, you can make that work, and in some rare
circumstances where you're trapped on a desert island that might be
your only option.The rest of us will just use a hammer.
knz42 - 8 minutes ago
And this is why CockroachDB has an audience.