Delicious flat che^H^H^Hfiles (30)

1 Name: #!/usr/bin/anonymous : 2006-12-02 10:33 ID:SeI56d3E

I was wondering, does anyone here have anything interesting to say about flat files for data storage ? Recommended reading, tips, tricks and advanced concepts...

You see, I'm not a big fan of relational databases. I do understand them very well, actually I pay my bills by working on a quite big database application, it's just that I like the simplicity and beauty of flat files. And real men don't need DBMS anyway. OK, let's not talk about RDBMS.

Say, which markup language / data serialization format do you like ? Have you used xattrs in any project ?

2 Name: #!/usr/bin/anonymous : 2006-12-02 12:16 ID:/lRkt3Yv

Flat files are cool for data which is written out once and then read in again. 3D meshes, configuration files, high score tables, user preference data and so forth.

For things you'd like to modify a record at a time, where reading the file in and writing it out again slightly differently isn't acceptable, there's either something like GDBM or Berkeley DB, or the more heavy and serious RDBMS of your choice. I mean, it's not like most of us would like to spend a year or more putting together a storage engine when people, smart people, have written (and debugged!) such things for us. Plus, Berkeley DB has concurrency control without a server. How cool is that?

3 Name: #!/usr/bin/anonymous : 2006-12-02 15:40 ID:l0kpOZof

I like to write XML files and store them in RDMS

4 Name: #!/usr/bin/anonymous : 2006-12-02 16:38 ID:lPdrDISa

JSON is a cool serialization format. (YAML is ok too but JSON is simpler and good enough)

5 Name: #!/usr/bin/anonymous : 2006-12-02 22:50 ID:O+ba3X+r

>>3
Very good ! I just hope you use Java, otherwise, you know... it wont scale and wont be enterprise leading, paradigm shifting solution.

>>4
Word, JSON is beautiful.

6 Name: #!/usr/bin/anonymous : 2006-12-02 23:05 ID:O+ba3X+r

Did you know that this board stores everything in flat files ?

I didn't have enough time to explore the source, but I believe they go into res[1] directory. It's weird... could it be that Kareha stores posts in XHTML ? Parsing through that shit every time... Also notice how meta data about thread is stored, view source and look at the first line.

[1] http://4-ch.net/code/res/

7 Name: #!/usr/bin/anonymous : 2006-12-03 12:31 ID:Heaven

>>6

Very little is parsed - the full html is stored on a single line, and can just be copied over to the front page. The only thing that is parsed is a regexp which replaces the body text with an abbreviated version when needed.

8 Name: #!/usr/bin/anonymous : 2006-12-04 08:46 ID:SeI56d3E

>>7
I see, that makes sense... still, no matter how you look at it, mixing data with the view seems to be a bad idea.

What if you want to change the view ( beyond CSS ), what if you need more than one view ( like RSS ), where will you store that data which shouldn't be on the view ( for example IP addresses ) ?

This thread has been closed. You cannot post in this thread any longer.