High-Performance Python Async
2026 Edition. A deep dive into accelerating Python asyncio with uvloop and directly interfacing with PostgreSQL using asyncpg's binary protocol.
Episodes
The Need for Speed: uvloop Architecture
3m 13sDiscover the architectural differences between Python's standard asyncio and uvloop. We explore how uvloop leverages Cython and libuv to achieve Go-like performance.
Dropping in uvloop
3m 45sLearn how to integrate uvloop into your Python application. This episode covers the EventLoopPolicy approach to seamlessly replace the default event loop.
Introducing asyncpg: The Binary Protocol
3m 38sExplore the fundamental design of asyncpg. We discuss why bypassing the standard DB-API for PostgreSQL's binary protocol yields massive performance gains.
Connecting and Basic Execution
3m 12sGet started with asyncpg by connecting to a database and running basic queries. Understand the native Postgres argument syntax.
Native Type Conversion
3m 23sDiscover how asyncpg automatically maps PostgreSQL data types to native Python objects, eliminating the need for complex ORM parsing.
Custom Type Codecs
3m 59sLearn to define custom data conversions in asyncpg. This episode explains how to use set_type_codec to automatically decode JSONB into Python dictionaries.
Advanced Codecs with PostGIS
3m 31sDive deep into custom type codecs by mapping PostgreSQL's PostGIS geometry types to Python Shapely objects using the binary format.
Managing Transactions
3m 23sMaster database transactions in asyncpg. We cover auto-commit behavior and how to safely execute multiple queries using asynchronous context managers.
Connection Pooling
3m 23sScale your application with asyncpg's built-in connection pooling. Learn how to efficiently manage database connections in high-traffic web services.
Prepared Statement Caching
3m 48sUnderstand how asyncpg optimizes query parsing with automatic prepared statements, and why external poolers like PgBouncer can cause conflicts.
Postgres Arrays and IN Clauses
4m 04sSolve the most common syntax error when migrating to asyncpg. Learn how to correctly filter queries against a list of values using ANY().
Record Objects vs Named Tuples
3m 52sExplore the unique design of asyncpg Record objects. Understand why dot-notation is omitted by default and how to enable it with custom classes.
Streaming Results with Cursors
3m 53sPrevent memory exhaustion when querying massive datasets. Learn how to use asyncpg cursors to stream results chunk-by-chunk.
Blazing Fast Ingestion with COPY
3m 27sSupercharge your data ingestion pipelines. We explore the PostgreSQL COPY protocol to bulk-load data exponentially faster than INSERT statements.
Asynchronous Listen and Notify
3m 10sUnlock real-time event-driven architectures directly within PostgreSQL. Learn how to use asyncpg's add_listener for instant pub/sub messaging.
Telemetry and Query Logging
3m 08sGain deep observability into your database performance. Discover how to use asyncpg log listeners to track slow queries and monitor execution telemetry.
Securing Connections with SSL
3m 24sEnsure your database connections are secure. We cover SSL context configuration and how to enforce direct TLS when connecting to cloud databases.