Wednesday, November 17, 2010

Static page apps -- where is the database?

Recently I've been doing a lot of work on applications integrating with social networks and came to the conclusion that with the jsonp apis available from Twitter and Facebook there is no need to actually have a database server, a web application server for dynamic html and all the other accoutrements that most web applications need.

This works rather well in a lot of cases (especially because of JQuery and newer frameworks for organizing single page apps, like sammy.js), I've only found 2 main things that frustrate going this way with all apps.
  1. Some very interesting API's do not have JSONP interfaces, this limits what we can work with and therefore what we can accomplish.
  2. There is no way to store data in a centralized database (HTML5 offers local storage options, but that doesn't allow for aggregation of data).
The first point above can be addressed using Yahoo!Pipes to essentially proxy calls and convert other kinds of output (XML, HTML, etc) to JSONP (see this). Yahoo!Pipes is a nice solution but doesn't have a strict SLA, published rate limits and an easy way to upgrade to a pay per request service.

The second point I haven't found any solution for at all. The problem seems to stem from the fact that private keys cannot be hidden client-side, therefore if one want to use something like Amazon SimpleDB one has to proxy the call themselves to keep their private keys stored securely server-side.

I think there is a spot for some cloud service businesses to fill the voids mentioned above (thinking Amazon style pay-per-use pricing model). I quickly mocked up a node.js app that takes a request with a API URL that is supposed to be proxied, gets the API URL, parses it and returns it as a JSONP response. Node.js is perfect for this kind of work because it is so IO intensive. The database issue is a slightly more difficult problem but is solvable as well.

Soooo.... Anyone interested in working on this? Anyone have some solutions I missed? Lemme know in the comments.

1 comments:

  1. I've played around a bit recently and came to the same conclusions for point #2. BUT, I did find a really stupid and hacky way of "storing" the some data for static apps. I basically throw a long URL to bit.ly with all my data in a param ?data= and use the shortened hash as the item key to store/retrieve/update that data.... I built a POC for this here: http://essperimentz.ca/T2

    ReplyDelete