The Hybrid Data Architecture

How pleb.school combines PostgreSQL and Nostr for reliable operations and portable content.
The Hybrid Data Architecture

The Hybrid Data Architecture

pleb.school keeps operational state in PostgreSQL while publishing content to Nostr. This gives you reliability and portability at the same time.

What lives where

PostgreSQL

  • Users and sessions
  • Pricing and purchases
  • Drafts and lesson ordering
  • Admin roles and permissions

Nostr

  • Courses (NIP-51)
  • Resources (NIP-23 / NIP-99)
  • Profiles (kind 0)
  • Zap receipts (NIP-57)

Why hybrid

  • Databases are fast and consistent for access checks
  • Nostr makes content portable and verifiable
  • Each published item is linked by noteId for fast hydration

Core flows

Publishing

Draft -> build event -> sign -> publish to relays -> store noteId

Display

DB metadata + Nostr content -> unified display object

Purchase

Zap receipts -> claim purchase -> access granted by DB entitlement

The hybrid approach is the core reason pleb.school can be both reliable and censorship-resistant.


Write a comment
No comments yet.