Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I work on distributed systems, and I thought this was a nice post and echoes some of my own sentiments.

The hardest problems in distributed transactions (banks, inventory, etc.) are often easier solved with human psychology (UX) than algorithms.

Hi, I am an ATM. Yes you have money, yes I am offline and can't check, yes you can withdrawal so you as the customer are happy with high availability. BUT I know who you are, and if you cheat me I will punish you when I find out!

Hi, I am a shopping cart. Why yes we have one of those in stock, but I am offline so I can't check. I'll take your money now and have it 2 day delivery for you. Oops, I just found out we don't have it in stock but I already have your money, this will take a few weeks now but we'll give you $20 off your next purchase - or do you want a refund?

This is the better approach, changing your business model to prioritize customer satisfaction (UX). Trying to build a globally consistent system instead either has to break the laws of physics with the speed of light, or make your customer have to wait - and if they have to, they probably won't be your customer anymore. One of these options is possible, but incorrect for your business, therefore use a distributed system with good UX.



> Why yes we have one of those in stock, but I am offline so I can't check.

Assuming the "I am offline" part is redacted, I view this as deliberate lying - deliberate in the "we already have your money" sense that you identified.

If I had made a decision to order with you because you had claimed something was in stock, but it wasn't, I will withdraw my patronage from you and I will complain loudly and vigorously.

This type of behaviour/UX has permanently harmed my relationship with several large retailers.


I think to call it lying is based on the assumption that there is some perfect answer. There usually isn't.

I work at a university library. Our inventory is fairly small on internet scale (~3 million items in 5 or 6 separate 'warehouses'; although we usually only have 1-3 count of each 'item' in inventory), so we don't really have these large scale/distributed problems. The biggest problem we have with the system saying an item is 'in stock' when it isn't is -- the item has been stolen or lost, and we haven't noticed yet and recorded it as such.

Is it "lying" if our system says it's on the shelf, when in fact it's been stolen or lost and we haven't noticed yet?

There are obviously ways we could improve our 'loss reduction'. But there will ALWAYS be cases where the system's knowledge is an imperfect representation of the real world, in any system.

"I've been offline for 10 minutes so the last information I have is as of 10 minutes ago" is just one more.

You can spend more money to try to make the information more accurate, but it will never reach 100% (even before you add in distributed computing, which adds some of it's own issues), so as with everything, it's cost-benefit, how much does the customer care, what can we afford to do, at what point is our information good enough to keep them happy -- and, like the OP says, how do we properly make the UX to keep them happy despite information that's not 100% accurate, which it NEVER will be.


I think the problem here is that these systems are frequently set up to look authoritative. "Hurry up! Only 1 left!" is a common sight on Amazon.

The user doesn't care about the challenges of a globally consistent distributed database, all they know is you said there was one left so they bought from you and now you're telling them you were wrong. You set expectations and then failed to meet them and that upsets people

If your system is not quite perfect, especially around something that can drive a purchasing decision, then make it clear to the user. "Hey, we're low on stock, we think we have 1 left but we might be out". Maybe you can even give a confidence interval, like "This item sells very quickly so we're probably out by now and don't realize it" vs. "we sell two of these a year and know that as of 5 minutes ago there was one left so we probably still have it". Now the user can make an informed decision.


That's where the "compensation" part of the original article comes in. If a company's doing this strategy right, they make it up to the customer in some generous way - "We'll give you a full refund and your next purchase is free" if the shopping cart says something is in stock and it isn't, "We'll pay for your remodel" if someone trashes your AirBnB, "We'll give you a free ticket" if you get bumped from a flight.

What some of the smarter big companies have realized is that emotions are fungible, and they work on a "last writer wins" basis. If you do something really nice for the customer after inconveniencing them (and it has to be more "nice" than the initial problem was "nasty"), they remember you making it up to them, not the initial problem. That shifts the cost of compensation back onto the company, which gives them an incentive to improve their systems, but also lets them trade-off occasional hefty compensation charges against getting 100% consistency & availability, which is impossible.


> I think to call it lying is based on the assumption that there is some perfect answer.

No, I don't make that assumption. I call it lying in the sense that stock information is given in the hope that it will convince me to use one retailer over another (and for no other reason). If the retailer is wrong for whatever reason, they have duped me. Deliberately - they weren't required to make such a claim.

That's absolutely distinct from the library case, where I understand that this information is only being provided to me as a service for my benefit. The information is not designed to trick me, but to save time compared to always searching manually. Thanks, by the way.


Personal curiosity: Do you still use Amazon? They do this behavior.

Clarification: It need not even be offline. Even if you are online, there is no way to tell if in the TimeToServer after you clicked the buy button that somebody else hasn't already clicked the buy button.

And you can't say this is trivially solved by a central master server that uses a "first come first serve" basis that then knows to report an error back to you after you clicked the button.

Why? Because the whole point of online shopping is that you might have customers on opposite sides of the nation or world. There is no guarantee they will hit the same server, or even if you sharded it so they will a single server can only physically scale up to so many requests.

So point being this IS NOT LYING, because suggesting I can communicate faster than light or predict the future is lying. As I believe the article mentioned, computers can only make their best guess. This isn't a lie, but yes they might make a mistake - and the best corrective action is to apologize and compensate.

It would be a far greater mistake to assume FTL knowledge, and a lie to think the machine can't sometimes fail and be wrong.


I've more often had the opposite experience with Amazon. They usually hit the early side of their delivery estimates.

Amazon manages my expectation correctly by saying "Only N left in stock" where that is appropriate. They have earned enough trust and applied this consistently well enough for me to believe they are saying this mostly for my benefit, rather than just to manipulate me into panic buying. Although I don't prefer to shop at Amazon, that's an impressive feat.

It is lying to make a blanket statement like "in stock" when you know there is a fair chance that it isn't.

The number of times when I will lose a "first come first serve" retail battle due to light speed should be infinitesimally small (or predicatable: ticket sales sites have developed a decent system for dealing with this). Even if this did happen, you could certainly recognise it before taking my money: you don't have to take my money at the speed of light. I don't believe this is the cause of any of the delivery/stock errors that I have experienced.

Compensating me by offering me money off my next purchase is not compensation: it's a shady marketing trick.


It is lying to make a blanket statement like "in stock" when you know there is a fair chance that it isn't.

Exactly. The CAP theorem isn't the customer's problem.

I do find it infuriating when a merchant tells me they have something in stock, takes my money, and then says they don't. The solution to this is easy enough for routine sales of off-the-shelf products: take the money at the time you physically ship the product to the customer. If you take an order in real time and then find you can't actually ship it within a short time after that order was placed then own up and offer the customer the best options you can.

A business that took my money for something they claimed was in stock but then didn't ship and held the money for a significant period would get a polite enquiry the first time, but if that didn't result in the product being shipped or an immediate full refund, they'd get the book thrown at them. This is probably the most common complaint I've heard among friends and family with on-line merchants as well, and as far as I can tell, pretty much everyone takes the same view about this one.

Compensating me by offering me money off my next purchase is not compensation: it's a shady marketing trick.

I agree with this, too. Taking someone's money and then failing to provide the goods is breach of contract, pure and simple. A merchant can certainly offer the customer some form of compensation for the inconvenience. If they have a generally good reputation with that customer and it's a rare event then maybe the gesture will help to maintain that positive relationship. But the customer has no obligation to accept the gesture, and if the merchant does this systematically, they deserve every chargeback they get.


>> It is lying to make a blanket statement like "in stock" when you know there is a fair chance that it isn't.

Well, hold on. They're not intentionally lying. They are allowing a condition where an inaccuracy could present itself, but is that lying? That is the last information that the system has. I suppose we could always use UX labeling that doesn't imply any commitment, i.e. "Reported in stock" or "In stock at last check" and that would be more strictly accurate. I wonder how users would react?


>They are allowing a condition where an inaccuracy could present itself, but is that lying?

Yes. Allowing that inaccuracy to present itself only benefits the retailer, and only inconveniences the customer.


This is _exactly_ how Amazon works. It has a best guess at inventory at a given moment, but it's a snapshot in time that is sometimes wrong. The inventory is verified. The money is taken out. The pieces are all decoupled and essentially offline. This isn't a lie, it's an optimization and works quite well. If any piece fails, the recovery is obvious and easy to deal with.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: