views:

330

answers:

4

I'm looking for a javascript library that will let me store data in a client side database and in the back ground automatically sync the database back to the server's database

preferable something that supports a variaty of engines in the same way jStore for jQuery does

Looking around I can find anything

+1  A: 

Iam not 100% sure, but i think there isnt such a framework. I would recommend to have a look on Google Gears.

Google Gears supports offline storage on client side.

Another approach would be to check out the sourcecode of TidlyWiki. They have created an wiki system wich stores all data on client side.

ArneRie
offline storage isn't so hard as it once was, there are some libraries that support either Gears, HTML5 local DB and flash. the original question is more about the background sync with the server (when online)
Javier
Also, Google Gears is being dropped.
henrikh
A: 

I'm not aware of any library that does that nowadays. Even tough this is a possible idea, I must say that I'm not sure if making such library is a good effort.

It would have to provide examples of how to expose your server data to the library, how to calculate deltas, and so on. This would force the developer to change this server side code accordingly to the library's protocol. This could be great for new apps and websites, but this could be a pain to any existing site, with particular data structure, making the effort to implement this not so much preferable to developing your own Javascript to do that with current data already exposed by the app. All of these on top of potential security problems would be kinda hard to manage in one generic javascript library.

IMHO this is a great idea to make bundles or plugins to specific ORM based MVC frameworks, for example Ruby on Rails or Django. Since the framework itself has an abstraction to the data structure and many security fixes already bundled together, making a bundle to do that would be much more re-usable and more elegant.

Iraê
A: 

I've been doing some work on this. It seems to be almost possible using Google Documents. Most of the APIs are accessible via Javascript. Unfortunately the exceptions include things like upload and download, so while it's possible to enumerate documents, create files, change metadata etc all from inside the browser, actually getting at the data is a lot harder.

Google Spreadsheets do have Javascript APIs for accessing individual cells, so it's theoretically possible to store your data in a spreadsheet. Unfortunately there's another whole in the API where it seems to be rather hard to write data to a cell that previously did not have data in it, which means that once you've created your empty spreadsheet, you can't populate it...

David Given
A: 

Store.js deal with the client-side storage very well. Note that it supports IE6+ along with other browsers. For the server-side storage you might as well make your own script for that as it should not be difficult.

jairajs89