I've been using this file-format below as an alternative for flat-text files, and I'm wondering if there is a name for it...

Say you have this data in a CSV:

FirstName,LastName,Email,UserName,Notes
Bob,Smith,bsmith@email.com,bsmith,Bob likes chicken
John,Doe,jdoe@email.com,jdoe,
Steve,Jobs,STEVE@apple.com,STEVE,Steve Jobs likes things that start with "i"

In this "other" file format, there are 3 columns:

  1. Unique ID
  2. Attribute Name
  3. Value

The above data would look like this:

bmsith@email.com,FirstName,Bob
bmsith@email.com,LastName,Smith
bmsith@email.com,Email,bmsith@email.com
bmsith@email.com,UserName,bsmith
bmsith@email.com,Notes,Bob likes chicken
jdoe@email.com,FirstNameJohn
jdoe@email.com,LastName,Doe
jdoe@email.com,Email,jdoe@email.com
jdoe@email.com,UserName,jdoe
STEVE@apple.com,FirstName,Steve
STEVE@apple.com,LastName,Jobs
STEVE@apple.com,Email,STEVE@apple.com
STEVE@apple.com,UserName,STEVE
STEVE@apple.com,Notes,Steve Jobs likes things that start with "i"

I actually delimit on tab, but comma is easier to read for this. And in this example, any of the attributes could be used as a unique identifier.

link|improve this question
1  
Just wondering why you would use this format? There's a lot of redundant information using this method. – pelms Jul 29 '10 at 15:54
I updated the example to be more complete... the benefit it you don't need to have all of the attributes in a header row (so you could have thousands of attribute names with still having 3 columns...), and you don't end up with NULLs if a row doesn't have a specific attribute... you just omit that line – coonj Jul 29 '10 at 15:57
feedback

3 Answers

up vote 8 down vote accepted

EAV

link|improve this answer
This seems like it. Just, using tabs instead of commas as stated. – Ryan Jul 29 '10 at 16:33
yes this is what I couldn't find - thanks! – coonj Jul 29 '10 at 17:52
feedback

What you're doing is pretty much the epitome of a flat-file database organized in a tabular form.

link|improve this answer
not exactly though, I made the example more complete. It will never be more then 3 columns, where in flat-form it has to have as many columns as there are attributes – coonj Jul 29 '10 at 15:52
1  
Modern NoSQL databases have many forms, and one of them is the key-value database. It is usually maintained using a special DBMS and not by using a flat file, but I'd still label this as a flat-file database, specifically as a flat-file key-value database. – rumtscho Jul 29 '10 at 16:11
feedback

That format is still a CSV file regardless.

link|improve this answer
Except that it's actually TSV. – Ignacio Vazquez-Abrams Jul 29 '10 at 17:27
feedback

Your Answer

 
or
required, but never shown

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