Backend

Database Migrations in Production with Prisma

SSite Admin
23 tháng 06, 2026 1 phút đọc 433 lượt xem
Database Migrations in Production with Prisma

Migrations are easy in development and terrifying in production. Here is how to do them safely with Prisma.

Migrate Deploy vs Migrate Dev

Never run migrate dev against production. Generate migrations locally and apply them with prisma migrate deploy in CI.

npx prisma migrate deploy

Expand and Contract

Roll out breaking changes in two phases: add the new column (expand), backfill, switch reads, then drop the old column (contract).

Connection Pooling on Serverless

Use a pooled DATABASE_URL (PgBouncer) for the app and a DIRECT_URL for migrations.

S

Site Admin

Engineer and writer. Building things with TypeScript and distributed systems.

Bình luận (0)

Bạn cần đăng nhập bằng Google để bình luận.

Hãy là người bình luận đầu tiên.

Bài viết liên quan

99 Ngày Java — Ngày 58: Optional

Optional là công cụ cho kiểu trả về — không field, không tham số, không bọc collection; chuỗi map/flatMap/filter thay kim tự tháp if; orElse luôn tính tham số còn orElseGet lười, orElseThrow cho “không có là lỗi” — và các anti-pattern isPresent + get, orElse(null).

23 thg 9, 20269 phút9
99 Ngày Spring — Ngày 58: Spring Boot Actuator

Boot 3 mặc định chỉ lộ health; bản đồ endpoint an toàn và nguy hiểm; HealthIndicator tự viết với liveness tách khỏi readiness cho Kubernetes, info từ build và git, metrics Micrometer với tag hữu hạn — và ba lớp khóa: cổng riêng, SecurityFilterChain với EndpointRequest, exclude env/heapdump/threaddump.

23 thg 9, 202610 phút5
So sánh EasyExcel và Apache Fesod: khác biệt thật nằm ở đâu?

Fesod là hậu duệ của EasyExcel, cùng engine SAX/SXSSF. Khác biệt kiểm chứng được: vòng đời dự án, POI 5.2.5 vs 5.5.1, các API mới (numRows, csv(), headerMergeStrategy) và độ bền với file xấu — không phải hiệu năng gấp nhiều lần.

23 thg 9, 20268 phút1