When one should use MapDb vs regular database through an ORM? Other than having a direct mapping to Java.util.Map which can be implemented as well with an ORM.
2 Answers
Jan's answer is highly biased, since he is the author of MapDb.
MapDb is superb for "internal storage" and when there is a single entity with 'values' associated to it. Its interface is very straight forward, and you can either serialization in your own format (recommended) or rely on the highly compact internal serialization format in MapDb.
ORMs are most valuable when the stored data is under some type of "external control". This could be that there are storage policies in the company, pre-defined RDBMS schemas, or perhaps that the data must be queryable by some reporting engine that is made for SQL.
Then there are a multitude of situations where opinion and personal preference makes all the difference. Personally, I am in Jan's corner and think that ORMs quickly becomes incredibly hard to deal with, and if you take 'data migration' into account, I think MapDb (and many other NoSQL alternatives) wins out more times than not. For the case of external query engines, I would send data modification events from the primary application to a secondary system that interprets those and updates the "view" needed by such SQL-only systems.

- 584
- 4
- 14
I would use MapDB if you need extra performance and flexibility. Otherwise use regular ORM with DB.

- 1,084
- 7
- 4