Some people were testing the system by deliberately not voting for themselves. Also, Reddit doesn’t really run off a proper database. And there could be other consistency checks (I haven’t looked at the code).
Last I spoke with Steve Huffman, he told me they were running on top of PostgreSQL, but maybe they switched to something non-relational in the most recent rewrite. Now you’ve got me curious; I’ll check the source.
That’s not the problem, apparently, it’s that what Reddit built on top of the SQL is a huge list of key/value pairs or something like that—in any case it’s not as simple as an SQL query.
I just finished going through the source, and while it’s still Postgres-based, the schema just uses five tables: type, rel_type, thing, data, rel. So yes, it’s fundamentally just a key-value store. I bet I could still whip up some SQL that would do the trick, though it would be a good deal uglier than the above.
This is pretty much right, it uses a big key value store. The issue with karma is that the Account record maintains the karma value but the vote is stored as a separate relationship between the Account and the Link (article). Generally is is not safe to update the database directly as it is necessary to keep the separate memcache coherent. Thus any changes must be done via Python code. Whilst such a change is possible and relatively straightforward I’m not sure its worth it. From what I’ve seen there are no truly obnoxious users on less wrong that need to be dealt with by such a change.
Some people were testing the system by deliberately not voting for themselves. Also, Reddit doesn’t really run off a proper database. And there could be other consistency checks (I haven’t looked at the code).
Last I spoke with Steve Huffman, he told me they were running on top of PostgreSQL, but maybe they switched to something non-relational in the most recent rewrite. Now you’ve got me curious; I’ll check the source.
That’s not the problem, apparently, it’s that what Reddit built on top of the SQL is a huge list of key/value pairs or something like that—in any case it’s not as simple as an SQL query.
I just finished going through the source, and while it’s still Postgres-based, the schema just uses five tables: type, rel_type, thing, data, rel. So yes, it’s fundamentally just a key-value store. I bet I could still whip up some SQL that would do the trick, though it would be a good deal uglier than the above.
This is pretty much right, it uses a big key value store. The issue with karma is that the Account record maintains the karma value but the vote is stored as a separate relationship between the Account and the Link (article). Generally is is not safe to update the database directly as it is necessary to keep the separate memcache coherent. Thus any changes must be done via Python code. Whilst such a change is possible and relatively straightforward I’m not sure its worth it. From what I’ve seen there are no truly obnoxious users on less wrong that need to be dealt with by such a change.