Talk: architecture for a connected device+cloud app
How do you write a "connected device+cloud" app that works, and doesn't crash when the user walks out of network coverage? How can you make an "offline mode" that still syncs properly with the cloud? I'm passionate about correct distributed programming. Here are some slides I made:
- slides.pptx [500k]
- the transcript is in the "notes" section of the slides.
1. Network failures will happen even in the best-written programs and you have to deal with them. I wrote a NuGet package called "Async Mr Flakey" to help you write robust code.
2. Retry-on-failure is a terrible idea, leading to bad user experiences and buggy code. Please don't do it.
3. Getting good async callstacks out of exceptions. I wrote a NuGet package "AsyncStackTraceEx" to help.
4. Architecture - I strongly advocate for breaking your work down into idempotent resumable/retryable nuggets, and having "workitem queues" (in memory or on disk or in cloud). Then have a single WorkAsync method whose job is to do the work to move an item from any one of those queues into the appropriate next queue.
5. Use the UI thread for your WorkerAsync. It's easier, and won't hurt responsiveness.