Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 1.32 KB

File metadata and controls

35 lines (25 loc) · 1.32 KB

ADR-005: Why PostgreSQL for off-chain data vs a pure on-chain approach

Status: Accepted Date: 2026-03-24

Context

LearnVault generates significant metadata, including course content, student profile details, and high-resolution atmospheric data for meteorology assignments. We needed to decide what belongs on-chain (Stellar) and what belongs in a traditional database.

Decision

We have adopted a Hybrid Architecture: Stellar for value transfer (Escrow) and identity (SBT), and PostgreSQL for all relational off-chain data.

Consequences

Positive

  • Search Performance: Complex joins and full-text searches on student progress are near-instant compared to indexing blockchain events.
  • Cost Efficiency: Storing 1GB of course videos and PDFs on-chain would cost thousands of XLM; PostgreSQL handles this at negligible cost.
  • GDPR Compliance: Allows for "Right to be Forgotten" requests by deleting off-chain PII (Personally Identifiable Information) while keeping the cryptographic proof on-chain.

Negative

  • Centralization: The database becomes a single point of failure unless managed with high availability (RDS/Cloud SQL).
  • Data Integrity: Requires a hashing mechanism to "anchor" database snapshots to the blockchain to ensure off-chain data hasn't been tampered with.