开发者

How should my application keep clients in sync with schema changes to HTML5 databases?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜