This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Here is the essential subset of the current database schema, not including the Postfix tables and such. It's just a simple relational database schema. Yes, it is simplistic and limiting; when I took over rewriting the website, there was already a simple database there so I chose a similar schema in order to make the transition fast and simple.
A while ago, I started writing a new database schema which I've put here; its basic idea is that everything that can be displayed on its own page - users, classes, categories - is an object and goes in the objects
table. Associations between objects has a parent-child relationship: for example, a user signed up for a class would be inserted in the associations
tables with the class object ID as the Parent and the user object ID as a Child. Messages between users would be similar - sender is the parent, recepient is the child. The attributes
table was to stores data relating to a specific object or association so that the objects
and associations
tables could be kept as simple as possible; for example, the contents of a message would be an attribute of an association, class details such as syllabus and so on are attributes of the class objects, and so on.
The advantages of this approach should be clear. It is extensible since the creation of a new "thing" is just a new row in the objects
table and it can immediately be associated with other parts of the site using the associations
table. Extending site functionality would not require changing the database schema at all. Downsides are additional computational complexity when pulling and formatting data, but this is an unavoidable tradeoff and I think that the additional flexibility makes it worth it.
The new database schema should also be particularly compatible with object-oriented programming approaches, whether it be a PHP object or a Python class.
Another advantage is that data regarding the network of users would very easy to pull out for analysis. If we want to have an idea of the degree of communication between users, we can immediately pull out all User object
s and all user-user association
s (i.e. messages), create a weighted graph with users as vertices and edges as messages, the weight of an edge being the number of times a message has been sent between those two users. This visualization software seems as though it would excel for these purposes.
And so on.
I didn't finish polishing off the idea of this schema and it will probably be slightly modified to be ideal. The other possibility is that someone can come up with a better system. I am open to any sorts of improvements.
Subreddit
Post Details
- Posted
- 13 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/a:t5_2t2oh/...