jsfest / sf-cfp

JSFest Call for Proposals
43 stars 1 forks source link

Building Offline First Apps Today #36

Open jkleinsc opened 10 years ago

jkleinsc commented 10 years ago

The time has come to build offline first applications. As developers we have no excuse for our applications performing poorly or not at all when a data connection is unavailable. When we build applications that take offline as a primary design consideration we can provide our users with robust applications regardless of connectivity.

Modern web browsers provide us with all the tools we need to build offline first applications. Some of these tools have gotten a bad reputation. I am looking at you Application Cache! IndexedDB you are slightly better than your annoying older brother WebSQL, but let's not pretend you don't have issues as well. I hear that Service Workers will come in soon and save the day, but what about today?

We can and should be building robust offline first applications today. We will examine an offline first application that is currently deployed across Africa to understand the challenges and solutions of building these apps using today's browser technology. We will also examine the current technology landscape to get a better understanding of what is possible offline in today's browser.

jkleinsc commented 10 years ago

The story behind the talk:

About a year and 1/2 ago I was presented with an interesting challenge. The organization I work for, CURE International, needed a medical records database for our hydrocephalus program so that we could keep track of patient treatment as well as provide research data for surgeons at Harvard Medical.

There were some unique challenges to this project: 1) The locations for our hydrocephalus program are in the third world, mainly African countries. 2) For the most part we do not have physical locations where we can maintain servers for data collection. 3) We needed something portable that could be taken out in remote clinic locations. 4) We needed to be able to sync to a central location for research and reporting purposes. 5) In most of these locations the internet access is poor at best.

In taking these challenges into consideration, I felt that an "offline first" browser application was our best bet. The first and foremost design consideration for this app was that it needed to perform flawlessly while offline.

When I started the project IndexedDB was not completely stable (Chrome had a slightly different implementation that other browsers), but for the most part it was usable. Chrome had just introduced the FileSystem API and it appeared to be a useful offline tool as well. Around this time, Jake Archibald started talking about the Application Cache and the challenges it presented. While it presents its own challenges, I found that Application Cache provided what I needed for my offline app.

So, armed with these tools, I built an offline first medical records database that is currently deployed to 12 different countries in Africa. To be honest, there are challenges with using these offline technologies, but I would argue that as web developers we are smart enough to get past those challenges and create awesome applications with today's browser technologies.

mikeal commented 10 years ago

This talk is accepted, you should be a collaborator on the speaker repo now. https://github.com/mikeal/jsfest-speakers