Consumer Messaging Platform — WhatsApp-Class System  ·  View 18 of 23

Core Data Model

Thirteen entities covering accounts, devices, keys, conversations, envelopes, receipts and media — and the column that is conspicuously absent.

Editable source SVG draw.io All views
contact_link
account_id FK -> account
contact_hash PK
is_blocked
discovered_at
contact_link...
account
account_id PK
phone_e164 UNIQUE
display_name
about_status
photo_blob_id
created_at
account...
device
device_id PK
account_id FK -> account
platform
is_primary
registration_id
last_seen_at
device...
device_key
key_id PK
device_id FK -> device
key_type identity | signed | onetime
public_key
consumed_at
device_key...
status_post
status_id PK
account_id FK -> account
blob_id
audience_rule
expires_at
status_post...
membership
conversation_id FK
account_id FK -> account
role member | admin | owner
joined_at
membership...
device_inbox
device_id FK -> device
message_id FK -> message_envelope
ciphertext BLOB
state
expires_at
device_inbox...
receipt
message_id FK
device_id FK
state delivered | read | played
recorded_at
receipt...
call_record
call_id PK
conversation_id FK
kind voice | video | group
started_at
duration_s
call_record...
conversation
conversation_id PK
kind direct | group | broadcast
created_by FK -> account
created_at
conversation...
message_envelope
message_id PK server
client_msg_id UNIQUE per sender
conversation_id FK
sender_device_id FK
created_at
expires_at
message_envelope...
media_blob
blob_id PK
sha256_ciphertext
size_bytes
mime_type
expires_at
media_blob...
group_metadata
conversation_id PK FK
subject
description
icon_blob_id
only_admins_post
group_metadata...
1 : N
1 : N
1 : N
1 : N
1 : N
1 : N
1 : N
1 : N
1 : N
1 : N
1 : N
1 : N
1 : N
1 : N
1 : N
1 : N
1 : 1
1 : 1
1 : N
1 : N
1 : N
1 : N
1 : N
1 : N
0 : 1
0 : 1
Core Data Model
Core Data Model
message_envelope has no body column. Content exists only as ciphertext in device_inbox, until acknowledged.
message_envelope has no body column. Content exists only as ciphertext in device_inbox, until acknowledged.
v 1.0 · owner Platform Architecture · date 2026-08
v 1.0 · owner Platform Architecture · date 2026-08
Text is not SVG - cannot display

No body column

  • message_envelope carries routing metadata and nothing else
  • Content exists only as ciphertext in device_inbox, until acknowledged
  • A database dump of the durable tier yields who messaged whom, never what

Device-centred

  • Inbox and receipt rows are keyed by device, not by account
  • This is what makes multi-device a schema property instead of a feature flag
  • device_key holds identity, signed and one-time keys in one table by key_type

Shown, not exhaustive

  • Keys, foreign keys and the columns needed to follow a join
  • Sharding keys, audit columns and soft-delete flags are omitted
  • Presence, typing and session state are cache structures, not tables