Designing for Accidental Disconnects: Our first attempt at an offline approach
blog.getchop.io
blog.getchop.io
I invite any networked application engineers to come spend a week developing here. You can go for peaceful walks in the woods and question your bad assumptions about always-on/always-fast networking!
I wish more companies would embrace the two - one would think obvious - points:
- there is such thing as "cache"
- if a thing can be done off-line, it should be done off-line; stop pushing shit to cloud out of laziness
Signed,
A person who is constantly infuriated by the shitty, cloud-first state of mobile infrastructure.
Kudos to them for taking it on, but I don't really fault other ecommerce vendors for giving up early on offline functionality.
Confirming a transaction while offline is usually not an option. Preparing my shopping cart and getting everything ready to just press the "Confirm purchase" button when the connection is available, again, is. (I actually worked for a company that builds a product where this is the core functionality.)
Holding full product page info based on just a search is tricky too. Would need the search to cache things like upsell, cross-sell, product options, and so on, that don't usually come back with search. Or short of that, an alternate product page layout that deals with missing info.
If 90% of your online purchases are made from desktop browsers, maybe you have nothing to care about. If 90% is mobile, it may be worth paying attention to this approach. Currently, AFAIK, mobile buyers are 30-40% of typical e-commerce audience.
Honestly, I'd be satisfied with the following pattern:
- if you can't connect, fail fast - tell me that you can't do the operation because of an intermittent connection
- never ever destroy data because of a connection problem; in particular, I hate it every time when an app clears its display before attempting to execute its on-line stuff, which results with me losing the previous state - this way, I take an actual risk each time I execute an operation in the app
Think about a Metro North train traveling underneath midtown Manhattan in tunnels until it gets to 125th st. in Harlem. While underground, even the best wireless carriers like Verizon and AT&T can't get much of a signal through layers of earth and the metal faraday cages that are train cars.
The most infuriating thing is that if Spotify thinks it should have a network connection, because it has a 1xRTT signal with only 1 bar, but no data is actually flowing, the app will just hang and spin trying to connect forever, and become completely unresponsive. You have to enable airplane mode to convince the app that yes, there really is no data access underground.
In general mobile developers do a terrible job of actual real-world testing connectivity under a variety of packet loss and latency scenarios.
I would strongly recommend that you automate unit testing that inserts random amounts of packet loss and latency into the network connection to see how your app performs. There is open source software like WanEM (WAN emulator) that can do this for you: http://wanem.sourceforge.net/
For example, if you're Spotify, and your app spins for 3 minutes and has to be force quit because network connectivity is degraded, you should probably identify this in automated unit testing and not force your customers to live through this terrible user experience.
https://aws.amazon.com/about-aws/whats-new/2016/12/simulate-...
Murder all of the bad Wifi. It'd fix half the problem.
Of course, you can't offline the whole internet... But with reasonably good personalization, you can get some of the parts that matter most. For example, in the case of a food ordering system, the app can know the menus for restaurants used before, and have those ready to go offline. And then get the menus for restaurants that match the user profile, in the local area.
Also, Elon Musk now has the go ahead to put LTE-in-the-sky sats everywhere. Aren't in range of a tower? You probably have a wide open shot of the sky.
I see. Since its an acronym and doesn't reference to a person named Bart lets call that the BART problem.
> Im assumign the India problem is access point overloading.
On WiFi? In large cities the WiFi problem is bigger, but 5 GHz alleviates a lot of the pain if you are stationary. I've been seeing a lot of cheaper phones (even recent) only having 2,4 GHz. My router can only set itself it either 2,4 GHz, or 5 GHz, so having one device which only can do 2,4 GHz is a problem. In large cities, the solution here appears to be more 4G APs.
If you're moving, 4G (or WiFi AP in the mobile vehicle using 4G like the trains have here) solves the problem since it supports roaming very well and has a longer range than WiFi. There's also the option of Femtocell. For subway systems, the tunnels are already there (which includes safety exits and such) so building connectivity via Femtocells seems like a logical way to solve the problem. This does have a cost attached to it, and also planning and testing.
Sometimes I wonder how many applications are built essentially around a distributed, replicated database, and how useful periodic sync without a constant connection turns out to be. Email, IM, Dropbox, git are all great examples of that. Why can't more tools be built with the assumption of intermittent connectivity from get go?