We currently store data for a product I work on in ascii plaintext files in a format like this:
timestamp:2011120211T10:42:23
value:42
error:Foobar error
value:100
error:
timestamp:2011120211T10:43:58
value:0
...
I tried importing this exact data from one 13 MB text file into an Sqlite database with columns (DATETIME, TEXT, TEXT, TEXT, TEXT). However, much to my surprise, the file size of the database was also 13 MB.
Why is this? I would expect a database to use a format more space efficient than plain ascii, is that not the case?
That is definitely not the case. There is lots of metadata there, and space is actually often wasted in the name of efficiency, to allow for inserts, for indexing, etc.
The only time I would expect an ASCII dump to be larger than the database files is if the database was largely binary data which would need to be BASE64 encoded to be output as ASCII, and if there were no/minimal indexes.