-1

What is the best software or platform combination to use for storing variable data?

My data is in standard name-value pairs. At the top of the tree are a few broad categories, each of which will have a name and a value (category name) and also may have name-value pairs under it as well. These will have sub-categories and may have sub-sub-categories and sub-(n)-categories so on. Each of those will also have names and values and additionally have properties under each expressed as name-value pairs.

Naturally some flavor of XML makes sense; SQL/Relations DBs (my favorite) do not. As an example, the data may be similar to the below biological taxonomy.

<Kingdom>Animal
<Mammal>Yes
<Legs> 
    <4Legs>90%
        <EyeColor>
            <EyeColorBrown>40%
                <HairColorBrown>40%</HairColorBrown>
                <HairColorBlack>40%</HairColorBlack>
            </EyeColorBrown>
            <EyeColorBlack>60%
                <HairColorBrown>40%</ HairColorBrown>
                <HairColorBlack>40%</ HairColorBlack>
            </EyeColorBlack>
        </EyeColor>
    </4Legs>
    <2Legs>5%
        <EyeColor>
            <EyeColorBlue>20%
                <HairColorBrown>40%</HairColorBrown>
                <HairColorBlack>40%</HairColorBlack>
                <HairColorBlonde>40%</HairColorBlonde>
            </EyeColorBlue>
            <EyeColorBrown>20%</EyeColorBrown>
            <EyeColorBlack>60%</EyeColorBlack>
        </EyeColor>
    </2Legs>
    <NoLegs>5%</NoLegs>
</Legs>
</Mammal>
</Kingdom>

So, in my code, I want to create a form where for example if someone chooses 2Legs, it shows the three eye color options and choosing Blue there would show the three hair color options. Then, when the form is submitted, I want to be able to store the username with their set of choices, e.g.

<UserName>John Doe
    <Choice1>
        <Kingdom>Animal
            <Mammal>Yes
                 <Legs>
                     <2Legs>
                         <EyeColorBlue>20%
                               <HairColorBrown>
                      <...close each...>
    </Choice1>
</UserName>

I have heard of XMLDB, NoDB, NoSQL and a host of others, but don’t know where to start. I would like to be able to use the database with PHP and JavaScript, but beyond that how should I approach this?

Please also note that I want to be able to use different data sets eventually. In other words, I may do the above animal data and then use something similar to build a site for um.. let’s say furniture.

Chiwda
  • 1,233
  • 7
  • 30
  • 52

1 Answers1

0

Looks like a candidate for a document store DB, which you can read about on wiki: https://en.wikipedia.org/wiki/Document-oriented_database. I don't know anythin about PHP - but it looks like it supports Mongo (http://php.net/manual/en/class.mongodb.php), and perhaps some of the other options as well

This resource is fairly cool too: http://nosql-database.org/

There is no reason this can't be done in a relational DB - it would require a deep knowledge of the structure ahead of time. Which i guess is what you want to avoid?

akaphenom
  • 6,728
  • 10
  • 59
  • 109
  • This is good information, but too theoretical. I would like to compare different options for what I would use as a backend data store and therefore the best language to go with it. – Chiwda Oct 10 '15 at 17:11
  • Any document store should work for denormalized data. How much, how consistent, what kind of up time all drive choices. Mongo is very popular and has a good community - given the above we too theoretical, I recommend you start with mongo(PHP and Node both are supported easily). And see if that meets your needs. – akaphenom Oct 10 '15 at 17:25