tags:

views:

32

answers:

2

Consider I modify the way files are stored in a system, where every file name would actually be the table name in a database and each line in the file would actually be the rows of that table. Would that increase overall system speed? would it be worthwhile? what are the tradeoffs?

To further clarify the distinction between this and the normal use of a database, consider the files not to simply be text files, but also audio, video, binary, etc. where they are stored in the manner mentioned in the previous paragraph.

Immediate benefits that I can see from this is that i can read/write any line from/to a file without having to repeatedly read/write the previous lines until reaching the desired line. Another benefit would be simultaneous reading/writing of files.

Please do not confuse this with a database file system, this is a file implementation

+1  A: 
Akash Kava
File Browser Access: I assume that would be application specific, so it would be the responsibility of the application to know how to read from it if I provide an API (Video player, Text editor, etc.)
Saif
Yes, infact we also have 600GB of files and we store it in database, it becomes easier to setup replication, transfer, query and maintain, for small number of files database is costly but for huge number of files, it works well.
Akash Kava
Please check my blog entry, in the last line of the edited answer, you will find more details.
Akash Kava
Just read the entry, in relation to what you did I'm trying to do 2 more things 1) break down the blob even further to single lines. 2) make those blobs comprehensible so they could be read on their own
Saif
A: 

Maybe some benefits on speed are present, but there's a lot of issue which make the cons overwhelm the pros.

  • No easy way to support Transactions
  • No easy way to support typification of fields (think about a file with BLOB objects in it)
  • Relationship constraint
  • No trivial support for cache, accessing RAM is faster than accessing disk
  • No easy way to support something like "ALTER TABLE"

I guess that if you write something which support all this kind of issues you've written a sql engine...

Enrico Carlesso