Skip to content

Storage design

Keyspace

Each server uses only one keyspace.

Partitions

Partitions may be used as primary key and blob store, or as secondary index.

Objects

Stores all activities received by from inbox or outbox, and actors or objects referenced by activities, local or remote. Objects extracted from activities are separately stored in the same partition.

Primary key Value
ObjectKey(uuid_7: bytes) Object

KV separation should be enabled on this partition.

IRI Index

Index mapping object @id to object key.

Primary key Value
@id: String ObjectKey

Users Index

Stores index to local actor profiles.

Primary key Value
uid: String ObjectKey

The following ActivityPub properties are generated automatically

  • inbox
  • outbox
  • followers

Currently there is no following or liked collection.

Outbox Index

Stores all activities generated by local actors.

Primary key (UID, ObjectKey) Value
uid: String, ObjectKey None

Likes Index

Stores all likes received from inbox for objects.

Primary key (IRI, ObjectKey) Value
@id: String, ObjectKey None

Shares Index

Stores all shares received from inbox for objects.

Primary key (IRI, ObjectKey) Value
@id: String, ObjectKey None

Followers

Stores all followers of local actors.

Primary key (UID, ObjectKey) Value
uid: String, ObjectKey None

If needed we might have to add a reverse index to support efficient unfollow activity. For now we will just iterate through all prefixes.

Activity Context Index

Index mapping context @id to activities. This can be used to find all activities related to a context.

Primary key (IRI, ObjectKey) Value
@id: String, ObjectKey None