all repos — honk @ 22de29fa196462c93a85aeb15329d01955a9596a

my fork of honk

spec.txt (view raw)

 1
 2Some notes on the database schema. Mostly for development, but maybe useful
 3for administration as well.
 4
 5The config table contains settings, some of which may not be editable via the
 6normal interface.
 7
 8The welcome message on the first page is stored as servermsg.
 9
10For development purposes, adding a config value (debug, 1) to the database
11will disable caching and hot reload templates. It's not meant to be
12harmful in production, just less efficient.
13
14We don't use null, only empty strings. This is easier to work with on the go
15side.
16
17The main table is honks. This stores both locally created honks and incoming
18ActivityPub notes converted to honks. It is important to differentiate the two
19cases so that we don't accidentally publish external honks in the public web
20view. (Previously this was accomplished via separate tables. That made some
21queries more difficult, but I think it's possible to workaround this. It would
22be considerably safer.) The honker column will be empty for local honks.
23
24The what column further refines the type of honk. If a reply, tonk. If
25deleted, zonk. If shared, bonk. In particular for the case of bonk, there
26aren't enough columns to store original honker and bonker. This seems to work
27out okay though.
28
29The honkers table is used to manage follows and followers. The flavor column
30describes what. 'sub' is a follow. We have subscribed to their newsletter.
31'dub' is a follower. They get dubbed whenever we honk. We also use this table
32to store public keys for anyone we interact with. This is regrettable.
33
34The xid column generally corresponds to ActivityPub id. For local honks, it
35will be a short string, not a complete URL.
36
37Such explanation would be less necessary were the tables not misused for
38multiple purposes. Will probably split them apart again soon.
39
40Note that some logical seeming joins won't work. The honker column of honks
41does not have a correspondng entry in the honkers table, since we frequently
42receive messages from people we don't follow. Should we track everybody whose
43identity crosses our path? This seems unnecessary. The honkers table is more
44like a mapping of active relationships, not a directory of all peoples.
45
46Some deduping of honks is performed. Known shortcoming: only the first bonk is
47recorded. Subsequent bonks, even by different actors, are ignored. Bonus
48shortcoming: we download such bonks every time.