views:

170

answers:

1

I'm wanting to incorporate HTML5 database storage into my web application to make it online-accessible.

I've done lots of development in server-side environments with databases, and we all know that database schema additions and modifications are often necessary.

I am wondering what should happen if my application uses an offline database schema, and that schema changes. How do I prevent the application from breaking on the client side? How do I ensure the database is always up to date on the client end?

Anyone have any solutions?

+2  A: 

If you change the schema you might want to dump the browser db and re-sync it from the server. This would at least be the most safe way to do it.

If offline clients have added data to the db you should of course handle and up-sync of this data first.

An easy way could be to have a info table telling you which version of the application/db was used for last sync, so you know how to handle it, and also if it should be updated to latest version.

Fini
Yeah, that's what I was thinking. Maybe even a 'meta' database. This is going to be messy. I imagine we'll see libraries popping up sooner or later to make managing these scenarios easier.
Chad Johnson