Добавить
Уведомления

SQL25-01 Larry Ellison was Right (kinda) TypeScript Stored Procedures for the Modern Age

Larry Ellison was Right(kinda) TypeScript Stored Procedures for the Modern Age. Speaker: James Cowling February 10, 2025 https://db.cs.cmu.edu/seminar2025/#db1 Abstract This seminar explores the challenges of using SQL for business logic and proposes a modern approach: TypeScript stored procedures. Traditional SQL struggles with complex logic (e.g., bank transfers) due to its declarative nature, leading developers to rely on API services or client-side database exposure—both of which introduce inefficiencies, security risks, and consistency issues. Stored procedures (e.g., PL/SQL) were an early solution but failed due to poor ergonomics and isolation. The talk advocates for running TypeScript directly in transactions, combining developer-friendly workflows with database safety. Convex, a system implementing this, demonstrates: TypeScript-first queries/mutations (no SQL needed) Automatic caching & real-time sync (like React for databases) Serializable transactions via MVCC (multi-version concurrency control) LLM-friendly code for AI-assisted development The approach bridges frontend/backend divides, eliminates manual caching, and scales for OLTP workloads while avoiding traditional stored procedure pitfalls. Short List of Content 00:00 Start 00:05 Introduction (0:050:42) Seminar kickoff at Carnegie Mellon University. Focus: Replacing/improving SQL. Speaker: James Cowling (Convex, ex-Dropbox). 00:42 SQL’s Limitations (0:423:20) Example: Bank transfers are cumbersome in SQL (lack of control flow). Business logic belongs in procedural code, not query languages. 03:20 Current Workarounds (3:207:05) API Services: Complex, slow, and prone to leaks. Client-Side DB Access: Sacrifices transactions/security. 07:05 Stored Procedures Revisited (7:0510:36) PL/SQL’s flaws: Esoteric, unsafe, and poorly isolated. Solution: TypeScript in transactions (developer-friendly + safe). 10:36 Convex Runtime (10:3615:01) Queries/Mutations: Pure TypeScript functions. MVCC: Serializable transactions via timestamp snapshots. No Query Planner: Joins handled in application code. 15:01 Benefits (15:0120:28) Free Caching/Subscriptions: Automatic invalidation. Real-Time Sync: React-like reactivity for DB state. LLM Compatibility: TypeScript’s structure aids AI-generated code. 20:28 Q&A (20:28–end) OLTP vs. OLAP workloads. Why not WASM/WASM? (V8 balances safety/flexibility.) How Convex handles distributed transactions. Key Takeaway: TypeScript stored procedures offer a unified, ergonomic model for database interactions, blending developer experience with transactional safety.

Иконка канала DatabaseInternals
12 подписчиков
12+
19 просмотров
9 месяцев назад
12+
19 просмотров
9 месяцев назад

Larry Ellison was Right(kinda) TypeScript Stored Procedures for the Modern Age. Speaker: James Cowling February 10, 2025 https://db.cs.cmu.edu/seminar2025/#db1 Abstract This seminar explores the challenges of using SQL for business logic and proposes a modern approach: TypeScript stored procedures. Traditional SQL struggles with complex logic (e.g., bank transfers) due to its declarative nature, leading developers to rely on API services or client-side database exposure—both of which introduce inefficiencies, security risks, and consistency issues. Stored procedures (e.g., PL/SQL) were an early solution but failed due to poor ergonomics and isolation. The talk advocates for running TypeScript directly in transactions, combining developer-friendly workflows with database safety. Convex, a system implementing this, demonstrates: TypeScript-first queries/mutations (no SQL needed) Automatic caching & real-time sync (like React for databases) Serializable transactions via MVCC (multi-version concurrency control) LLM-friendly code for AI-assisted development The approach bridges frontend/backend divides, eliminates manual caching, and scales for OLTP workloads while avoiding traditional stored procedure pitfalls. Short List of Content 00:00 Start 00:05 Introduction (0:050:42) Seminar kickoff at Carnegie Mellon University. Focus: Replacing/improving SQL. Speaker: James Cowling (Convex, ex-Dropbox). 00:42 SQL’s Limitations (0:423:20) Example: Bank transfers are cumbersome in SQL (lack of control flow). Business logic belongs in procedural code, not query languages. 03:20 Current Workarounds (3:207:05) API Services: Complex, slow, and prone to leaks. Client-Side DB Access: Sacrifices transactions/security. 07:05 Stored Procedures Revisited (7:0510:36) PL/SQL’s flaws: Esoteric, unsafe, and poorly isolated. Solution: TypeScript in transactions (developer-friendly + safe). 10:36 Convex Runtime (10:3615:01) Queries/Mutations: Pure TypeScript functions. MVCC: Serializable transactions via timestamp snapshots. No Query Planner: Joins handled in application code. 15:01 Benefits (15:0120:28) Free Caching/Subscriptions: Automatic invalidation. Real-Time Sync: React-like reactivity for DB state. LLM Compatibility: TypeScript’s structure aids AI-generated code. 20:28 Q&A (20:28–end) OLTP vs. OLAP workloads. Why not WASM/WASM? (V8 balances safety/flexibility.) How Convex handles distributed transactions. Key Takeaway: TypeScript stored procedures offer a unified, ergonomic model for database interactions, blending developer experience with transactional safety.

, чтобы оставлять комментарии