hatmopa.blogg.se

Going from flat files to relational database
Going from flat files to relational database













going from flat files to relational database

SQLite reads and writes small blobs (for example, thumbnail images) 35% faster¹ than the same blobs can be read from or written to individual files on disk using fread() or fwrite().įurthermore, a single SQLite database holding 10-kilobyte blobs uses about 20% less disk space than storing the blobs in individual files. If going from flat files to a DB results in a 1% efficiency improvement but adds a week of figuring things out when you have to update the code have you really improved things.

going from flat files to relational database

In six months when I have to maintain your code (or you do after working another project) which way of storing and retrieving data will make more sense. How logical will the code look in six months? I emphasize this because I think this is too often forgotten in designing things (not just code, this hobby horse is actually from my days as a Navy mechanic cursing mechanical engineers). How will I be adding data? Can I just append a row to the end and that's perfect for my retrieval or will it need to be resorted? How often will I be accessing the data during one program execution? Will I go once to get all books with Salinger as the author or will I go several times to get several different authors? Will I go more than once for several different criteria? How am I consuming the data? For example will I just be reading from the beginning to the end rows in the order entered? Or will I be searching for rows that match multiple criteria? Some questions I would ask myself when making the choice include: I even recently moved some data from a SQL database to a flat file system because the overhead of the DB, combined with some DB connection reliability issues, made using flat files a better choice. This is the kind of question that has no generic answer but is heavily dependent on the situation at hand.















Going from flat files to relational database