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.

Ata Iravani
  • 2,146
  • 7
  • 29
  • 40

2 Answers2

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)

Community
  • 1
  • 1
Lemex
  • 3,772
  • 14
  • 53
  • 87
  • 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. – Ata Iravani Aug 01 '12 at 08:10
  • what do you mean by "JSON can be index if you create them corerctly"? How can a json DB become indexed? – Ata Iravani Aug 01 '12 at 08:20
  • Updateed answer with link to similar question – Lemex Aug 01 '12 at 08:22
  • Atleast with a JSON you could save to a file and read/write when opening/closing your page. – Lemex Aug 01 '12 at 08:24
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.

Dominic Green
  • 10,142
  • 4
  • 30
  • 34