Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an environment that supports both dictionaries (json style) and databases (not relational or anything, just formatted data by row and column). My application doesn't really need database functionality, butI'm somewhat more comfortable with the database system than I am with dictionaries. Is there a major performance advantage to dictionaries? What situations are there where a dictionary is better than a database?

share|improve this question
up vote 3 down vote accepted

If you want to know whether there is a performance advantage, the best thing to do is measure it yourself. The performance depends a lot on the type of data, the language, the amount of data, etc.

It's impossible to give a blanket statement as to when dictionaries are better than databases. Again, it depends on the data, the language, etc. Roughly speaking, dictionaries are better for simple and small datasets, and databases are good for complex and large data sets.

share|improve this answer
-1 for reading comprehension. The person asking is meaning completely different by 'database'. – Boris Yankov Jan 8 '12 at 19:47

If you want to distribute your application you don't need a database when you use json-dictionaries.

I use dictionaries for 'small datasets', so I can maintain them - like my sourcecode - with an editor. If I would use a database, I need a administration tool for my DB.

share|improve this answer
There some databases that doesn't require an administration tool, and can be embedded in an application. For example, check out sqlite if you haven't heard of it before -- your whole DB is just a single file. – Bryan Oakley Jan 8 '12 at 19:32
know sqlite. But if I want to modify data (e.g. a quick change to test something), I need a short script/command or an administration tool. With json (I use yaml) I can use the editor and change the textfile. – knut Jan 8 '12 at 19:36

Your Answer


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.