GWT "database" (client-side)
I'm looking for something like a database for GWT objects (inside the browser). It must work without HTML5 or Gears (or any browser plugins). It doesn't have to be capable of everything a database can do, but the most important features would be
- automated indexing, on multiple columns
- some kind of API or language to perform (a limited subset of) queries
It could be a bit similar to Taffy DB, but it must have automated indexing, and开发者_运维百科 it should provide a GWT API. I hope, it would be even smaller in download size than Taffy, if it re-uses code from the GWT library.
(Maybe I should add, that I don't need permanent storage. It's ok, if the data has to be reloaded/regenerated when the user hits reload.)
XBSDB seems to be good library for client-side db plus indexing solution.
You may take a look at itemscript, it has an in memory "database" which you can query using REST-like URL fragments. I haven't tried it but it looks promising. I have to agree with tdavies that if you like Taffy, writing JSNI wrapper around it is quite trivial task.
Some time ago I created simple in-memory database-like system in GWT, where I leveraged existing Comparator interface for sorting, created simple Filter interface, and simple Query used to store any number of Comparators and Filters. Simple generic ModelManager class which stored model objects in one of collection classes and was running my Queries. It worked pretty well even without any support for indexing.
You won't find any existing solutions for your problem, I spent huge amount of time looking for one. Apart of that, why not give HTML5 a try?
Have you looked at Dojo's Data Store?
I'm not sure how well it fits your specific needs, but it's a pure JavaScript solution. Like much of Dojo, the documentation can be a bit difficult to sort through, but there's an article about using Dojo Grid and the basic MVC pattern on developerWorks that may interest you.
http://www.ibm.com/developerworks/web/library/wa-aj-dojogrid/index.html
Cheers.
Have you looked at SQLite? Here's a handy video tutorial...
http://www.youtube.com/watch?v=DZSZIfhzc3A
I'd suggest you reconsider your design, browsers are not the most responsive of applications on a good day for a variety of reasons. In addition to this the design of embedding a database in the browser session (no matter how light) is placing explicit demand on the thin client. The thin client may or may not have the resources to support the requirements.
If you have explicit control over the thin clients (corporate environment?) it would be best to leverage some desktop technologies or applets (java?) outside of the immediate browser context.
I have written a small library for doing client side storage in GWT. Its based on local-storage and works on all HTML5 browsers (including the smart phone browsers). It allows you to store data in object stores and databases.
You can check it out here, and see if it meets your needs: https://code.google.com/p/gwt-localstorage-db/
精彩评论