2

I'm currently working on a client-side project with Html5 and javascript. I need create a large database (almost 2GB), and also I need to make this database portable. In other words, I actually need to store the database into a binary file, migrate it, and retrieve its information.

As the result of my recent research I found two good solutions (especially for Android and IOS)

But none of them really helped me. I should mention that my application is going to work on Desktop, Android, IOS, and any other platform that is going to support most of HTML5 features.

I should also mention that my DB is preloaded.

7
  • so whats your question ? Commented Aug 1, 2012 at 7:32
  • I could not find a way to store my database into a binary file. Commented Aug 1, 2012 at 7:33
  • Yes, Do you have any other suggestions? But I actually need to retrieve the information by javascript. Commented Aug 1, 2012 at 7:38
  • Ive found it easier to write a small convertor that transfers my database into json and then store the json strings in local storage. Commented Aug 1, 2012 at 7:39
  • Doesn't json have any limitations, especially in case of Size ? Commented Aug 1, 2012 at 7:41

2 Answers 2

3

I would highly recommend JSON, This article will explain some more: Databases using JSON as storage/transport format

I have personally used this one before which works well and loads its DB from a JSON: http://www.persvr.org/

JSON can be index if you create them corerctly, there basicly fully flexible and good for stroing, as far as i know they dont have any limitations as there just big strings when stringify and objects when parsed, Is there a limit on how much JSON can hold?

Also something similar has been asked before: Using JSon like a Relational SQL Database (Javascript)

Sign up to request clarification or add additional context in comments.

4 Comments

As I mentioned, my DB will have 2GB size. So I think json is not going to help me (at least in case of size). And one more problem with json is that it is not an indexed Database, therefor, when my app is going to search through database and the performance will be reduced to a very bad level because json is not indexed.
what do you mean by "JSON can be index if you create them corerctly"? How can a json DB become indexed?
Updateed answer with link to similar question
Atleast with a JSON you could save to a file and read/write when opening/closing your page.
0

I have personally found that it is better to write my database tables to json format, and then store the json into local storage as a string. This means your javascript will be able to easily access and modify the data client side, and what ever your using on the backend should be pretty happy working with it to put it back into what ever database your using if needed.

1 Comment

Is json an indexed database? Doesn't json have any limitations, especially in case of Size ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.