DataModel

Edwin Miguel Triana

Data Model

Date: November 18, 2011
Version: Initial proposal

The data model proposed here is based on the Cassandra's data model.

User (Column Family)

  • Key: UUID randomically generated (SHA-1)
  • SuperColumn: all columns has name, value, timestamp
    • firstname: ASCII
    • lastname: ASCII
    • password: md5 hash. It could use the "salt+md5(pass) to avoid Rainbow Tables.
    • email: ASCII, Unique email. Field is indexed.

Example

User{
  xx-aa-bb{
    firstname {name: firstname, value: john, timestamp: 123456789}
    lastname {name: lastname, value: smith, timestamp: 123456789}
    password {name: password, value: mymd5pass, timestamp: 123456789}
    email {name: email, value: jsmith@maritaca, timestamp: 123456789}
  }
  yy-dr-za{
    firstname {name: firstname, value: albert, timestamp: 123454389}
    lastname {name: lastname, value: einstein, timestamp: 123456384}
    password {name: password, value: mymd5pass, timestamp: 123456349}
    email {name: email, value: aeinstein@maritaca, timestamp: 123456349}
  }
}

Form (Column Family)

  • Key: UUID randomically generated (SHA-1)
  • SuperColumn: all columns has name, value, timestamp
    • xml: ASCII, RAW (String) xml representation of the questions.
    • userId: UUID of the form's creator. Field indexed.

Example

Form{
  ut-aa-bb{
    xml {name: xml, value: <form>...</form>, timestamp: 123456789}
    userId {name: userId, value: yy-dr-za, timestamp: 123456789}
  }
  po-aa-bb{
    xml {name: xml, value: <form>...</form>, timestamp: 123456789}
    userId {name: userId, value: xx-aa-bb, timestamp: 123456789}
  }
}

Response (Column Family)

  • Key: UUID randomically generated (SHA-1)
  • SuperColumn: all columns has name, value, timestamp
    • xml: ASCII, RAW (String) xml representation of the questions.
    • userId: UUID of the form taker. Field indexed.
    • formId: UUID of the form for this response. Field indexed.

Example

Response{
  pl-aa-bb{
    xml {name: xml, value: <form>...</form>, timestamp: 123456789}
    userId {name: userId, value: yy-dr-za, timestamp: 123456789}
    formId {name: formId, value: ut-aa-bb, timestamp: 123456789}
  }
  cv-aa-bb{
    xml {name: xml, value: <form>...</form>, timestamp: 123456789}
    userId {name: userId, value: xx-aa-bb, timestamp: 123456789}
    formId {name: formId, value: po-aa-bb, timestamp: 123456789}
  }
}

Future modifications

See Brainstorming - Data model


Related

Wiki: Home

MongoDB Logo MongoDB