Hello,
I have traditional relational database and i want to change the design to suit the table storage of windows azure. after reading a book and some articles i still didn't come across a real life table storage scenario. so i thought of my own way in the design
and i want experts here help me in it.
the scenario is social network where users post on their friends walls ( i call this post "Status") and others comment on each status. so the traditional database had these tables:
User(ID, Name ... ), Status(FromID, ToID, Subject, ...), Comment(StatusID, Subject ...).
now to store that in the azure table storage i thought to merge all tables together in one table by using one entity for all like this:
Entity(ID, Name, StatusTopic, CommentTopic, RowType, ...)
this entity represents any of the traditional tables. depending on the RowType enum i can recognize if a row is a User, Status or a Comment.
why i make this design is because i want everything related to a user to be set together in the same partition. so now i partition the table by the ID. when i open a user's wall i will get the related Statuses and Comments from the same partition. and when
i want to insert a user for example, i will supply properties for the User (his name, age ... etc) and set the RowType to "User" and omit properties which are not related to identifying the User (StatusTopic, CommentTopic ..etc). when i insert a Status i set
the RowType to "Status" and supply the StatusTopic and omit properties which are not related to Status. inserting a Comment is same with an extra property StatusID to link Comments with a specific Status.
for searching and varied queries, i want to make copies of rows. for instance, suppose i want to search for a Status by StatusSubject -regardless on which wall this status reside-. if we want to search in such a design our search have to scan all partitioning
servers then come back with the result, which would be slow. so i thought to copy each Status to another table which has its own partitioning for such search purposes.
any problems with such design?
Thank you.
Alan-SY