danlucraft /blog

Untethered Webapps

October 2009 • Daniel Lucraft

For a few days now I’ve been tossing around some ideas about how to write a web application that doesn’t need a server. As a developer, I’d like to have the same freedom from dependencies that users’ have when they install a webapp by just visiting a URL.

So here’s the deal: write a todo list application and a blogging application (the two Hello Worlds of the web) that don’t require me, as the developer, to maintain servers to support the users.

But I want to keep the stuff that makes users love webapps:

  • Easy to install
  • Seamless updates
  • Available from any web accessible computer

We’re going to need some infrastructure to exist if this is going to work. But it’s only necessary to imagine two online services:

  • OpenDB. This is a REST accessible database service, with authorization that restricts access with a username and password. It has a user friendly registration system.
  • OpenServer. This is a REST accessible file system service, that serves the contents of a specified directory up to the web. It supports domain names and has a user-friendly management panel.

And that’s it. Here’s how the webapps work:

The Server-free Todo List Application

Installation example

I write my application: The Untethered Todo. It’s just JavaScript and HTML. I deploy it by making those static files available on my web server.

My user arrives, and loads up the application from my server. The application is now running in the user’s browser. The app hasn’t got any persistance configuration, so the first thing it does is ask the user for the details of a database provider. The user - who is an early adopter, and quite tech savvy - types in the url and password of his OpenDB account.

The very first thing the application does is offer the user a single url, that he can bookmark and use to load the application up with the same database in future. The OpenDB url is encoded in the query string parameters, so next time the user will only need to type their password.

Then the app sets up the schema and any other initial database configuration. In this case it creates an example project and todo item. Now the app is ‘installed’ and ready to go.

Whenever the user loads the app from now on, the app will connect to the OpenDB database from the connection information in the query string and work from there.

From now on the application stores all its information in the OpenDB instance. If the user creates a new todo, the app (which is running solely inside the user’s browser) will post the required information to the database. Lists of projects are loaded up over that connection too, through a JavaScript ORM layer wrapping the HTTP calls.

At no point will the application need to talk to the developer’s servers. So I won’t need any. But since the user is loading up the app every day from my domain, I get to release updates straight to the user.

And that’s how I’m going to write a todo list web application that doesn’t require any hosting.

The Server-free Blogging Software

Dependencies

It’s a little bit more complicated to imagine blogging software that doesn’t need the developer or the user to run a server, because there are third parties involved now too. There’s me, the developer, there’s the blog author, and there are the blog visitors.

So in this case, when the application loads, it asks for OpenServer information. It then creates the blog as static files in a directory on OpenServer. Whenever the author writes a new post, the app creates the necessary files on OpenServer.

The author goes to OpenServer and specifies that she wants this domain attached to that directory, and any visitor to the domain name will see the blog served from OpenServer.

I imagine that the blog software wants to set up an OpenDB database as well. If the OpenDB provider supports ‘users’ (perhaps they are running MySQL), then there is a ‘commenter’ user that has insert-only access to the ‘unmoderated-comments’ table. Then when the author logs back in, the application - still running from her browser - loads the unmoderated comments and let’s her approve or delete them, before they are written to OpenServer as part of the blog.

Random Thoughts

  • Server costs are zero.
  • There’s no such thing as downtime - from my point of view.
  • I don’t have control over the user’s database - so schema migration must be done very carefully.
  • I don’t get to see usage information about my software.
  • Every web application written in this fashion has an automatic data API.
  • If there are going to be multiple OpenDB and OpenServer services, what do the common API standardS look like?
  • Does anything like OpenDB or OpenServer exist already?
  • Why does the MySQL multiple user access model suddenly seem so attractive again?
  • When do I get to write these apps? :)
blog comments powered by Disqus