Managing Large amounts of Data in Javascript - javascript

I'm currently in the process of making an App using Javascroipt and Phonegap that needs to save a Database or something similar localy while offline until it is later synced with an external Database (not the main Problem).
So whats the best solution for managing relativly big chunks of data that have to be modified a lot during runtime, be able to delete entrys, add new entrys, read entrys using attributes and ids, sort entrys and be able to import and export data in a file (i.e give me a string or object that I can save in a file using phonegap)?
I already looked at TaffyDB (abandonned since 2 years) and pounchDB (seams to work using ajax and therefore require internet connection).

Its good that you have already tried pouchdb.js that is client side implementation of couchdb database and is supported and tested for all the major browsers and platforms.
indexeddb is actually latest web browser standard for storing large chunks of data in the form of objects.
All the major storage libraries including pouchdb are based on this only.
Kindly mark this answer if this is what you need or comment back for more explanations.

Related

Store data on server without Database

I’m webGL engine developer (ThreeJS) in small company. We have some events in few weeks and my boss just told me that i have to make registration form as soon as possible, also one page should show names, lastnames and company of all registered members. Problem is that i’m very bad in databases and i have really small amount of time to re-learn it. How can i store registration data on Server without Database? I looked up on web and most instructions are unclear(because i’ve not worked on database before) and others are using localstorage (as far as i know its used for cacheing data)
What you're looking for is a flat file database system, try taffyDB it basically use Json to store its data or Papa parse that uses CSV files, you can easily edit with excel for example.
If you're really good with javascript you can consider using a real database after all,mongodb is a bit advance but still not as complicated as mysql or even sqlite.

JSON file simultaneous reads

I've been tinkering a bit on a small application which would show a limited amount of data to the viewer in a nicer way. I was thinking instead of opting for a database (be it SQLiteor / MongoDB) to have my data stored in a simple json file. It would have below characteristics:
Static data (will never have to be updated - 100-150 arrays)
Not private data - can be freely accessed by anybody which has access to the application
Offline application (not a single connection with internet)
Multiple users which would read only the data
JavaScript being used for this
What I am wondering about though is simultaneous reads. The application would never be used to update the data, it remains static. However there might be several people using the application simultaneously. As the tool will be stored on a shared drive, accessible by several other clients at the same time (only to read the file).
As I haven't touched anything with data or databases yet, I'd wanted to see if anybody already tried this out before I go into it deeper.
I am aware of the implications in terms of security however the data inside the application is not secure data and can be accessed by anybody freely. I only want to show it in a nice way. And as it is static anyway I was going to opt for a JSON file i/o starting to work with a database to speed up the development.
As far as I can see from your description, I think that there should be no conflict. You should be fine.
It's actually fairly common to use JSON-formatted files to store truly-static data.

Write/Read file in Firefox OS

So I got a new GeeksPhone Peak, and started making apps in HTML5, CSS, JavaScript.. It is great, I love it, but now I'm trying to make a timetable app and I have to save data, when I fill my timetable (just text) somehow, and reload it when the app is loaded.
I started searching and found localStorage, IndexDB, backbone.local-storage but couldn't really find great tutorials on them. Or is there a special API for that case? Can someone help me on which one to use, or how to write to file, save it, read it, etc.?
FirefoxOS provides multiple mechanisms for supporting persistence in your application. While considering the choice between local Storage and Indexed DB, your decision will rest on how important the following points are for your application:
How easy the API is use [Local Storage is easier. Simple key-value pairs]
Synchronous v/s Asynchronous API [Local Storage is synchronous. IndexedDB has both modes]
Transaction Support [Indexed DB has it]
How easy it is to do Search [Since local storage is just key-value pairs, it is difficult to do searches especially if your values contain complex structures]
A good article that provides comparison is here.
In case, you want to take a look at how to use the localStorage, IndexedDB APIs on FirefoxOS, I have written tutorials on the same: localStorage & IndexedDB & Device Storage.

Sencha touch - is it possible to store a large database on the client

I'd like to be able to store, not a massive amount of data but not a trivial amount either on the client. Basically, I want to be able to use something like an SQLite database on the client side using Web technologies. The application is a foreign language dictionary so I want this data to be accessible once the application has been downloaded.
Is this possible with Sencha touch or any JavaScript/HTML5 technology?
There's several options depending on the target browsers:
localStorage (has the advantage of being cross-browser back to IE8)
WebSQL (deprecated)
IndexedDB
Application Cache (this is a stretch for data storage...but it /can/ be done)
All of these technologies have storage limits, some of which vary between browsers, and to complicate things even more, some will let the user choose to allow expansion of the storage ceiling.
I've used localStorage with good results, and using a JavaScript compression library ( http://code.google.com/p/jslzjb/ ), you can gain some storage advantage (though in my experience, not a lot. If you're at 5.5Mb with a 5MB limit, the compression might get you by, though)
Yes it is. The only question is what type of data, but you can store anything.
If its a lot of text/object data you can use localstorage. Not sure how large the dictionary is, but that might be a very simple solution. You can download the dictionary to the client and then use JSON.stringify() to convert your data to text (a string), and the local store can store it and retrive it.
A link to help, with other options including a database option:
http://www.html5rocks.com/en/tutorials/offline/storage/

Delete data from GPS unit using Garmin Communicator Plugin API

I'm building a project that relies heavily on data read from a bunch Garmin eTrex HC devices, to do that I use the Garmin Communicator Plugin API, I have successfully found the device, read the data and uploaded it to a server where I will do further data manipulation.
However, I now want to delete the data I have read from the device, I have found nothing in the API reference provided by Garmin and now, I need to turn to you clever folks in order to solve my problem since I've been tearing my hair out all morning trying to figure this out.
I cannot rely on the person carrying the device to reset it properly since there is an angle of competition in the mix.
Any way I can delete the data from the device will be greatly appreciated, any solution that involves, deleting data, resetting the device or really, whatever.
If the community answer is "This cannot be done" I will have to accept that and do some fact checking on the server side (which I might do anyways) in order to prevent data uploaded multiple times.
It looks like garmin simply hasn't included this natively into the API, but...
When you delete data you're actually writing data.
It doesn't look like the JS file GarminDevice.js has any method for removing data. I would write zeros or otherwise into the data space.

Categories

Resources