Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am using a library that returns a JSON object (as a string, but I think that's standard), and I would like to store the contents of this object into a local database.

I'm fairly fresh-faced in terms of interfacing with DBs, but I can find my way around. I was using a MySQL database to store the data, but this involved using methods to extract the fields of the raw object, and slicing and dicing.

I'm wondering if it would be more efficient to use a NoSQL solution to store the data, as it's already in the right form.

share|improve this question
6  
Have you seen CouchDB? –  Joseph Weissman Sep 30 '11 at 4:18
    
@Joe I've been dabbling with MongoDB over the past few days, I think they are similar? –  jonsca Sep 30 '11 at 4:19
1  
I think it depends on the amount of data you have :-) –  user39156 Oct 21 '11 at 13:55

3 Answers 3

up vote 10 down vote accepted

The decision of whether to use relational DB or non-relational (document/OO/graph) database should not be based on the representation of the data (JSON/BSON/XML/...), but on the operations you intend to preform on the data.

If you have a strict schema, and you need to execute SQL queries - You should use relational DB. Otherwise, you may consider other options.

Look here to consider your options.

share|improve this answer
    
Great link. I would be likely be inserting data about as often as I would be retrieving it, would that change anything? –  jonsca Sep 30 '11 at 8:29
1  
The main question remains how would you search for the data you want to retrieve. –  Lior Kogan Sep 30 '11 at 11:50

well that really depend on your need. for small data you can live with the RDBMS, but for a real system n big data you need have object database. your question can be narrowed down to ODBMS from no-sql.

Cache DB from intersystems is a good candidate for solution. cache is object database with no strictness on the schema. here your objects can be mapped to db objects. so you have 1-to-1 mapping and therefore no translation (slicing) is required.

as you have mentioned Json you can also use total free solution from intersystems GloblasDB which have its bindings to Java.

as mentioned earlier this totally depends on your need what system you are building.

share|improve this answer
    
Thanks for the two ideas. I ran through a bunch of the ones that Lior had posted above, too. There are a ton of options! –  jonsca Oct 21 '11 at 13:27

MongoDb uses BSON - Binary JSON for data storage. Maybe it will be helpful for you.

share|improve this answer
    
That's really what I was asking, will it be helpful for me? Does it make a difference? –  jonsca Sep 30 '11 at 8:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.