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?

2 Answers 2


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.

  • 1
    -1 for reading comprehension. The person asking is meaning completely different by 'database'. Jan 8, 2012 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.

  • 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. Jan 8, 2012 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, 2012 at 19:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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