-1

I'm trying to switch my brain in to a NoSQL mode (document oriented database). I created a JSON datastructure that looks a little bit like this

{ 
  "listInstances" : [
    {
      "listClassId" : 1,
      "listInstanceName" : "Test",
      "instanceFields" : {
        "header" : [
        ],
        "rows" : [
        ]
    }
  ]
  "listClasses" : {
    "1" : {
      "listClassName" : "Class A",
      "fields" : {
        "header" : [
        ],
        "rows" : [
        ]
    }
  }
}

Essentially listClasses are the templates for a listInstance when a list instance is created it is assigned a template and it will take it's own copy of the fields (instanceFields).

Am I going about this the right way, this feels like a relational model (listClassId)?

Edit: As for the operations imagine an app that shows the listInstances in a table of some sort, this table can be added to (this is the point where the list class type is selected) and have instances removed, list entries can be modified to add or delete rows into their fields. The table entries can also be filtered on instance key/values (for example I'm not showing it here but imagine another key "instanceCategory").

0

The database model is not only defined by the data (your JSON documents for e.g. mongodb, your tables for an SQL database) but also by the operations on the data: the queries, or the updates.

Without knowing what are your operations on your data, we cannot help you. If all your operations are finding some "object" by one particular "key", it would look as a relational database.

Read also NoSQL & documented-oriented database wikipages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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