ข้ามไปที่เนื้อหาหลัก

Prisma vs Supabase: Choosing the Right Backend Stack for Modern TypeScript Apps

 


What They Are : Prima vs Supabase ?

Prisma

  • A type-safe ORM (Object-Relational Mapper) for Node.js/TypeScript.

  • Generates database clients, models, and migrations you use in your app code.

  • Works with many SQL databases (PostgreSQL, MySQL, SQLite, SQL Server, MongoDB, etc.).

  • Focuses on database access, schema modeling, and safer queries. (Supabase)

Supabase

  • A backend-as-a-service (BaaS) built on PostgreSQL.

  • Provides an integrated stack: hosted database, authentication, real-time subscriptions, file storage, APIs, and edge functions. It is often described as an open-source alternative to Firebase. (Leanware)

👉 Key takeaway: Prisma is a tool for interacting with databases; Supabase is a platform that includes a database plus many backend services.


Core Differences

📌 Scope & Purpose

Supabase

  • Full backend stack: DB hosting + auth + APIs + real-time + storage.

  • Ready-to-use services with minimal setup. (Leanware)

Prisma

  • Focused on database layer: fluent queries, migrations, and type safety.

  • Doesn’t host a database or provide auth, storage, or real-time features. (Leanware)


Developer Experience

Supabase

  • Provides a REST/JS client with auto-generated APIs from PostgreSQL.

  • Great if you want less backend code and faster setup.

  • Real-time subscriptions and RLS (Row-Level Security) are built in. (Leanware)

Prisma

  • Offers type-safe queries and schema definitions in your code (less SQL boilerplate).

  • Excellent if you want strong compile-time guarantees (especially in TypeScript). (Leanware)


 Database Migrations

  • Prisma has its own migration system (Prisma Migrate) that generates versioned changes. (Leanware)

  • Supabase uses PostgreSQL’s native tooling and its dashboard for migrations; Prisma can manage migrations even if the database lives in Supabase. (Supabase)


Auth & Security

  • Supabase: Built-in authentication and role-based access with PostgreSQL’s RLS policies. (Leanware)

  • Prisma: Doesn’t include auth — you implement authentication yourself (with libraries like NextAuth or Auth0). (Leanware)


Real-Time & Extra Services

  • Supabase: Real-time updates, edge functions, file storage — all integrated. (Leanware)

  • Prisma: Only core database access; you must add real-time, storage, and serverless logic via other services or frameworks. (Leanware)


Performance & Scaling

  • Prisma adds a small ORM layer overhead, which can impact raw query speed vs direct SQL or Supabase client calls. (Answer Overflow)

  • Supabase’s hosted PostgREST API and built-in connection pooling often perform very well for simple queries. (Leanware)


When to Use Which

ScenarioBest Fit
Fast MVP / full backend with auth, real-time, storageSupabase
Type-safe DB access in TypeScript with complex logicPrisma
Custom backend API + DB logicPrisma + Supabase DB
Database-agnostic project (not tied to Postgres)Prisma

Using Them Together

They’re not mutually exclusive — many teams use Prisma with Supabase’s PostgreSQL:

  • Supabase handles hosted DB + auth + real-time.

  • Prisma gives you a robust ORM layer in your backend code. (Leanware)

This combo gives you faster development and strong typing without giving up Supabase services.


Summary

FeaturePrismaSupabase
Database Access✅ Type-safe ORM✅ via client / REST
Auth❌ (separate)✅ Built-in
Real-time
Storage
MigrationsBasic / via dashboard
Database Hosting
Best forBackend logic & safe queriesFull backend with services


ความคิดเห็น

โพสต์ยอดนิยมจากบล็อกนี้

Anvil แฟลต์ฟอร์ม สำหรับ Python Full Stack มีครบ จบในเครื่องมือเดียว

Anvil แฟลต์ฟอร์ม สำหรับ Python Full Stack มีครบ จบในเครื่องมือเดียว Avil เป็นแฟลต์ฟอร์มสำหรับสร้างเว็บแอพลิเคชั่น ด้วยภาษา python สามารถใช้งานทั้ง HTML CSS JavaScript SQL ทั้งหมดนี้รวมในเครื่องมือที่ชื่อว่า Anvil Python ใช้สำหรับรันบนบราวเซอร์ เซอร์เวิรส์ และสร้าง UI ด้วยวิธีการ Drag-and-Drop เพียงลากวาง UK และยังสามารถเชื่อมต่อและใช้งาน Database  และยังสามารถ Integration กับแฟลต์ฟอร์มอื่นๆ ได้อีกด้วย โครงสร้างของ Anvil  การออกแบบง่ายๆ ด้วย drag-and-drop ใช้ python เป็น client-side และรันบน บราวเซอร์ Server-side รันบน Anvil Server สามารถใช้ Database ต่างๆ เพื่อเก็บข้อมูล สามารถรัน python บนเครื่องและตอบโต้กับแอปพลิเคขั่นไดด้

อะไรคือ NPU (Neural Processing Unit) มีความสำคัญอย่างไร แนวคิดมาจากไหน

ความหมาของคำว่า NPU (Neural Processing Unit)  NPU (Neural Processing Unit) คือ หน่วยประมวลผลโครงข่ายประสาทที่สร้างมาเพื่อใช้งานด้านปัญญาประดิษฐ์ เป็นหน่วยประมวลผลพิเศษที่ออกแบบมาเพื่อใช้ในแนวคิดของการเรียนรู้ของเครื่อง (Machine Learning) ของคอมพิวเตอร์โดยเฉพาะ ทำให้การประมวลผล AI ทรงประสิทธิภาพเพิ่มขึ้นจากเดิมของ TPU GPU และ CPU เช่น การจดจำภาพ, วิเคราะห์เสียง, หรือการแปลภาษา ทำได้รวดเร็วและประหยัดพลังงานกว่า CPU/GPU ทั่วไป โดยทำงานคล้ายโครงข่ายประสาทของมนุษย์ และพบได้ทั้งในสมาร์ตโฟน, คอมพิวเตอร์ (PC), และอุปกรณ์ AI อื่นๆ ในอนาคต เพื่อเร่งความเร็วของการทำงานของ AI สามารถจัดการงานและปัญหาที่ซับซ้อนได้อย่างมีประสิทธิภาพ  ประวัติความเป็นมาของ NPU (Neural Processing Unit)  ตั้งแต่ปี 1970 เป็นต้นมาเราได้ใช้เริ่มมีการใช้หน่วยการประมวลผลแบบดั้งเดิม คือ หน่วยประมวลผลกลาง (CPU) ถือเป็น "สมอง" และเป็นกลไกการทำงานของคอมพิวเตอร์ ดังนั้นซีพียู CPU ประมวลผลงานคำนวณแบบดั้งเดิมส่วนใหญ่มีหน้าที่รับผิดชอบการทำงานของแอปพลิเคชันให้มีศักยภาพหลากหลายเพิ่มมาเรื่อย แม้ว่าจะมีหลายประเภท แต่โดยทั่...

TomCat สำหรับติดตั้ง แก้ไข คอนฟิก ใช้งาน JSP

Apache Tomcat เป็น  HTTP Server ที่มีความสามารถนำภาษาจาวามาใช้งานได้  สามารถใช้เทคโนโลยีของภาษาจาวาที่เรียกว่า Java Servlet  และ Java Server Page (JSP)  Tomcat เป็นโปรแกรม Open-Source  อยู่ภายใต้การดูแลของ Apache Software Foundation  (ซึ่งเป็นผู้สร้าง Apache HTTP Server ที่เป็นที่นิยมใช้กันอย่างแพร่หลาย)  สามารถอ่านรายละเอียดของ Tomcat ได้ที่  http://tomcat.apache.org  โดยเลือกหัวข้อ “ Documentation”  และเลือก “Tomcat 7.0” ขั้นตอนการติดตั้ง Tomcat เรียงลำดับดังนี้