Skip to content

Phase 7: Decision Gate and Rollout

Goal

Decide whether Prisma Postgres should become TendSocial's primary production database based on measured operation counts, query performance, and event-log offload results.

Decision inputs

InputSource
Prisma setup reportPhase 1
API operation reportPhase 2
Standard Playwright operation reportPhase 2
Exhaustive Playwright operation reportPhase 2
DB tuning before/after reportPhase 3
Index before/after reportPhase 4
Cache before/after reportPhase 5
Analytics/event offload reportPhase 6
Estimated monthly Prisma operationsPhase 2 aggregate
Estimated monthly storageSeed + forecast
Prisma pricing tier fitPricing model

Cost model

Use the operation-count report to calculate expected monthly usage.

Inputs

text
monthly_active_users
avg_sessions_per_user_per_month
avg_actions_per_session
avg_orm_ops_per_action
background_ops_per_month
storage_gb

Formula

text
interactive_ops =
  monthly_active_users
  * avg_sessions_per_user_per_month
  * avg_actions_per_session
  * avg_orm_ops_per_action

total_ops =
  interactive_ops + background_ops_per_month

Prisma price reference

PlanBaseIncluded operationsIncluded storageOverage
Free$0100k500 MBn/a
Starter$10/mo1M10 GB$0.008 / 1k ops; $2/GB
Pro$49/mo10M50 GB$0.002 / 1k ops; $1.50/GB
Business$129/mo50M100 GB$0.001 / 1k ops; $1/GB

Source: Prisma pricing.

Go/no-go criteria

Go

Proceed with Prisma Postgres if:

GateTarget
Dev/staging stableYes
Runtime uses pooled URLYes
Migrations use direct URLYes
Top 20 expensive actions fixed or ticketed100%
High-volume analytics/event logs removed from PrismaYes
Normal dashboard load<10-20 Prisma ops
Calendar/content load<20-30 Prisma ops
Draft/post save<5-15 Prisma ops
Background jobsBounded and paginated
50-user forecastPro or lower preferred
500-user forecastBusiness or lower preferred
Rollback plan testedYes

No-go / delay

Delay cutover if:

ProblemAction
Operation counts are dominated by N+1 patternsComplete Phase 3 first
Calendar/content routes are unboundedComplete pagination/index work
Analytics/events still write to PrismaComplete Phase 6
Connection exhaustion appearsCheck pooled/direct URL split and PrismaClient singleton
Cost forecast exceeds Business earlyRework query shape/caching before cutover
Rollback path is untestedDo not cut over

Rollout plan

Step 1: Staging cutover

  1. Point staging backend to Prisma Postgres.
  2. Keep Neon untouched.
  3. Run smoke tests.
  4. Run API operation suite.
  5. Run standard Playwright suite.
  6. Run exhaustive suite.
  7. Review Query Insights.

Step 2: Limited production shadow

If possible, duplicate non-mutating reads or replay production-like traffic against Prisma benchmark/staging. Do not double-write user-facing production state unless explicitly implemented and tested.

Step 3: Production cutover window

  1. Freeze deploys.
  2. Verify Supabase Auth unaffected.
  3. Verify R2 unaffected.
  4. Point backend production env to Prisma Postgres pooled URL.
  5. Verify CLI/migration env has direct URL.
  6. Deploy.
  7. Run production smoke test.
  8. Watch errors, query volume, operations, and latency.

Step 4: Fallback

Maintain Neon fallback for an agreed period:

text
minimum: 7 days
preferred: 14-30 days

Rollback means restoring the backend database env vars to Neon and redeploying.

Production monitoring after cutover

Watch:

text
Prisma operations per hour/day
Prisma plan quota burn rate
Slow query count
P95/P99 API latency
Connection pool utilization
Background job operation rate
Top repeated queries
Storage growth
Error rates

Final artifacts

The spike is complete when these are available:

text
reports/dbops/api-summary.md
reports/dbops/e2e-standard.md
reports/dbops/e2e-exhaustive.md
reports/dbops/e2e-exhaustive-hotspots.md
reports/dbops/tuning-before-after.md
reports/dbops/index-before-after.md
reports/dbops/cache-before-after.md
reports/dbops/analytics-offload-audit.md
reports/dbops/prisma-cost-forecast.md

Final decision statement template

md
# Prisma Postgres Decision

Decision: Proceed / Delay / Reject

Reason:
- Measured monthly operation forecast:
- Expected Prisma plan:
- Expected DB monthly cost:
- Top remediated hot spots:
- Remaining risks:
- Rollback path:
- Date:

Sources

TendSocial Documentation