0

Now, I have 200k objects in java, each of which have an unique ID. I will access them randomly later. So I want to save these objects into a database. Which kind of database should be a good choice? The relational database(MySQL) or some NoSQL database?

5
  • 2
    Do you need to store relations between the objects or just reference the objects by id? Commented Feb 5, 2013 at 21:10
  • If you only want to access by id any NoSQL-DB can do this. Commented Feb 5, 2013 at 21:11
  • 2
    This depends a lot on your other requirements. If retrieval by a unique ID is all you need is a commonly overlooked "database" type called "plain files" :-) Commented Feb 5, 2013 at 21:12
  • What's about performance requirements? What's about data growing? What the others persistence requirement might you have? Commented Feb 5, 2013 at 21:29
  • My need is simple, just access the objects by id. The number of objects is at most 200k. BTW, I want to store these objects on disk, not only in RAM, so maybe Berkeley DB would not help. (Am I right?) Commented Feb 6, 2013 at 0:32

2 Answers 2

1

I remember once working on a project where someone suggested that the ORM layer was unnecessary and over complicated the whole design.
He proposed that binary serializations should be written to a database table using the Object Id/Hash code, and a blob for the serialized object.

The problem that was pointed out with that approach occurs when the structure of a serialized Class changes, then all of the previously serialized object instancess need to be migrated/evolved.

So beware of storing a binary/serialized representation of an object for a long period of time.

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

Comments

0

In the end, I use the Berkeley DB, which is an embedded database which could access only through programming language.

Comments

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.