If the HN server uses an SQL database and has a table users containing the user names and their karma - and they must have something like that since the karmas are displayed on the profiles.
Flat files and Lisp macros, with everything stored as closures in RAM, AFAIK. HN doesn't use a relational database at all[0], unless they added one recently.
[0] http://arclanguage.org/