When Internet connectivity is ubiquitous today, we suddenly have another requirement, offline Web. Gmail, Google Reader, Zoho these excellent Web apps all support offline use, thanks to Google Gears. While the real offline Web relies on HTML 5, the future Web Language star will set a standard for offline storage for the Web, and the consortium has released HTML5 offline storage details.
One might say that offline Web is meaningless, you get just a crappy desktop program, in Wi-Fi, 3G ubiquitous today, we are most of the time online, which is true, but those of us who have been on a variety of WEB applications, such as email, online news and Twitter for a moment do not Offline Web is very important for people who are available or missing.
However, the problem is always there, HTML5 Web storage rules involved in a very complex problem, SQLite. Those who need to write offline Web programs need to write SQL code, SQLite is not wrong, but it is a variant of SQL, and the standard SQL is somewhat different, in addition, SQLite does not belong to the consortium, its owner is likely to change its interface one day, which will lead to those who have written the WEB program Must be rewritten.
Is there a better way? Atul Varma of the Mozilla lab recently released a blog post offering an alternative. Varma is studying an experimental version of CouchDB, which in the browser implements the semantics of the database in JavaScript. Ultimately, we might be able to use JavaScript directly to implement database queries, eliminating HTML5 problems in this area.
For this article, Mark Finkle, of the Mozilla Fennec Mobile browser team, said in a commentary that this scheme avoids more major problems in the background of standard databases, and that it is better to make localstorage/globalstorage a standard, keeping the standard at the bottom, In one of his blog posts, he points out that a JavaScript library should be built, just as many of the existing JavaScript libraries can manipulate page elements, and there should be a JavaScript library to manipulate offline WEB storage data.
This approach is superficially complex, but it will give developers a lot of flexibility, and we'll have more opportunities when the Web is omnipotent.