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 开发者_Python百科breaking on the client side? How do I ensure the database is always up to date on the client end?
Anyone have any solutions?
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.
精彩评论