Phase 2 / Ep 08: Database Engine Selection Debate

⏱ Est. reading time: 3 min Updated on 4/13/2026

After the PRD is finalized and placed in the docs/ directory, the next step is to determine the technical foundation and storage selection. This is often where independent developers are most prone to making selection mistakes ("I heard Supabase is popular recently, so I'll use Supabase. Oh wait, I heard Prisma is good too...").

Here, we will fully leverage the "external brain region" mechanism (especially the findings.md document) that planning-with-files provides to the Agent.

1. Introspective Inquiry: A Bias-Free Tech Stack Debate

Issue the following command in the Agent interface:

"Based on the overall PRD_System_Design.md we just reviewed, we currently need to establish a robust cross-platform synchronization transaction layer. Please compare pure Prisma + Postgres, the Supabase ecosystem, and pure Drizzle ORM horizontally. Which one is most suitable for us? Please provide the reasoning process. After reaching a conclusion, append our selection and the reasons for the decision to docs/findings.md (as an independent decision assertion)."

2. What Constitutes a Good "Diagnostic Write"?

A smart architect Agent (because GEMINI.md instructs it to pursue minimalism and lower barriers to entry) will analyze and deduce points such as:

  • Supabase comes with built-in Auth and real-time push, which is very appealing, but for our strong single-instance requirement of only Google Calendar single-point synchronization with no multi-tenant needs, it's slightly over-engineered.
  • Prisma offers a better DX (Developer Experience), making it highly suitable for execution in conjunction with Next.js Server Actions.

After the Agent confirms the adoption of Prisma, it will silently call the write_to_file tool or execute cat >>-like commands in the background (the system here will have specific tool instruction mechanisms requiring compliance with standards) to inject a permanent memory into your docs/findings.md:

<!-- Snippet from docs/findings.md -->
### [Decision Record] Database Storage Selection (2026-X-X)
- **Choice**: PostgreSQL + Prisma ORM
- **Rationale**: The system heavily relies on transactional operations for Google Calendar synchronization. Prisma's interactive transaction support makes rolling back local data streams very safe and is enhanced by type inference.
- **Rejected Alternatives**: Abandoned self-built Auth, purely using Google OAuth Session for password-less management.

3. The Power of ADR (Architecture Decision Record)

In engineering, this is called an Architecture Decision Record (ADR).

In traditional development, only senior, well-established teams maintain ADRs. Here, not only do you no longer need to manually type it out, but it's also written for future "other Agent subprocesses" to read!

When your testing Agent reports an E2E error tomorrow and questions why you didn't use the Supabase user table system, the main Agent only needs to read findings.md to firmly state: "Because we abandoned it at the very beginning of the architectural design," thereby preventing the entire development process from spiraling into self-contradiction.