From Synchronous to Asynchronous Postgres with Tornado
summary
Four implementations of the same tiny Tornado app—synchronous, momoko (Tornado) async, aiopg + asyncio, and gevent—are implemented and compared. The app is a one-table "game" insert/list using psycopg2 composites; models become coroutines for async cases and require connection pools and different cursor handling. asyncio uses yield from while momoko uses yield, transactions become harder under async pools, gevent keeps models synchronous inside greenlets. No throughput numbers or benchmarks are provided.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 1:42Talk overview
- 3:37ORM overview
- 6:49Synchronous implementation
- 12:50Using Momoko
- 20:11Using Aiopg
- 27:18Asynchronous challenges
- 30:51Using Gevent
- 38:02Summary and Q&A
related talks
40mOptimize Your Database Operations with Asynchronous Processing
30mBuilding modern Python web apps with PostgreSQL
46mInvestigating Multithreaded PostgreSQL
24mThe Upsidedown Stack: React on the Server and Postgres in the Browser
38mPostmortem: Evolution of an Event recording solution
15m"Stress Less: Easy Database Load Testing Using Python and Locust"
43mJust Use Postgres.
19mHow/Why to Sweep Async Tasks Under a Postgres Table
