This is a great demonstration of a feature I didn't know existed—using Dropbox to save application-level data. I'm sure I'm just behind the curve, but there are probably a lot of us back here. Nice move, DB.
There's a few projects around the idea of not requiring a dynamic backend for webapps. The general term is "unhosted" (unhosted.org), and it mostly started as a reaction to the we-have-your-data-and-can-use-it-however-we-want websites. RemoteStorage.io is probably the most mature unhosted library, and there's a few other services listed on unhosted.org that are being actively working on.
I got attracted to this idea because it offers several security advantages. I've been working on a minimalistic javascript library (byoFS.com) that allows you to connect a Dropbox/Google Drive/etc. account and write automatically encrypted data to it. I tied for 2nd place at a recent privacy hackathon for making an encrypted chat application using only Dropbox accounts:
I was wondering why this wasn't working, I have DB blocked at my office. Actually I don't have blocked their datacenter's IPs, I've only have blocked dropbox.com domain, if the JS library was in another domain it would work for me..
I'm not particularly informed on this, but what makes this different then just hosting a text file and reading the text file? I wouldn't imagine anything needs to be specialized for this.
Because when you do it this way, you don't have to host the text file. This doesn't seem like a big deal when we're talking about 2048 saves, but a imagine a book reader or image editor.
Ah, so it works for the full API but not the chooser? or have they fixed the content servers? This is what Dropbox Support originally told me when I contacted them about the problem:
> Thanks for writing in. It looks like the issue here is that our content servers (dl.dropbox.com) don't currently allow arbitrary cross domain access in JavaScript. (This doesn't apply to accessing the file directly in your browser, or downloading to your server locally, which is generally what one would do with the link returned by Chooser.) […] This is something that would need to be enabled on our side, so I'll be sure to pass this on as feedback.
One of the big advantages (not really used in this sample) is conflict resolution. With a text file, if you make changes on two different devices while one (or both) is offline, you'd end up with a conflict and two versions of the text file.
With datastores, the changes are automatically merged according to developer-specified conflict resolution rules.
keeping them coming, as I just started collecting all of these 2048 things here. http://2048.nerdspace.co/ it would be completed in a day or two, few are already listed.
Interesting to note that the datastore isn't really deleted when one revokes Dropbox access to the app, even though it's no longer listed on the datastores page - relinking the app to Dropbox resurrects the previous data.