Blog

Technology-Agnostic

Architectural Playground

Juun

Playground
  1. Timeline
  2. 11
0112025년 10월
INFRASTRUCTURE

Serverless Database Integration

Backend 서버를 추가로 관리하지 않기 위해 Prisma ORM 과 Neon 의 serverless PostgreSQL 데이터베이스를 통합

NeonPrismadatabaseedge computingserverlessArticle

Situation

The file-based dynamic routing blog system was a prototype designed to be database-driven from the start. Running a private server just for blog articles was overkill, and the infrastructure decision had been delayed for too long.

Task

  • Integrate a serverless database without requiring a traditional backend framework
  • Create a reusable, framework-agnostic database package

Action

  1. Chose Neon PostgreSQL via Vercel Integrations for serverless infrastructure delegation
  2. Integrated Prisma ORM for type-safe database access
  3. Created @juun/db package with no React/Next.js dependencies
  4. Implemented singleton pattern to prevent connection pool exhaustion
  5. Organized queries using namespace pattern (post.get.all(), post.get.byId())

Result

  • Zero backend framework code required
  • Type-safe database access from schema to UI
  • Automatic scaling with scale-to-zero cost optimization
  • CI/CD pipeline includes Prisma generation in postinstall
  • Database package reusable across different frameworks
Created
2025년 10월 20일