UPDATE: Relational Model may not work in the way I want it to, see:Database normalization for facebook-like messaging system
Time for NoSQL!
I am having trouble putting a database into 2nf. For that, you must determine all functional dependencies before you can decide if an attribute is prime or non prime.
Have a look here:
--------------------------------------------
to | from | msg | time
--------|--------|----------------|---------
joe | jim | hello | 1
jim | joe | hey | 2
jim | joe | how are you | 3
victor | bryce | i love carrots | 4
joe | jim | im doin great | 5
bryce | jim | hello | 6
NOTE: Time will be unique. It will be transacted.
Does time->message despite
time1->"hello"
time6->"hello"
Because I have heard as long as there are unique instances of message, its fine. However, I am confused by this.
Also, I want to add a message id column. Is that good practice?