Building a MySQL Database Driver in Elixir
summary
Shows how a working Elixir prototype driver parses executables, PNGs and the MySQL initial handshake packet using binary pattern matching, and talks to servers over gen_tcp. Implements MySQL packet framing, builds and sends the handshake response, decodes OK/EOF packets, and plugs into the DBConnection behavior for pooling and retries. Claims a readable production-grade MySQL driver stays under ~5,000 lines (far smaller than many language ports) and that a useful prototype can be assembled in hours, which the presenter demonstrates.
AI-written summary · about
chapters (34)
- 0:00Introduction
- 2:08Alan Ecosystem Foundation
- 2:47Elixir Pattern Matching
- 3:59Elixir Miner
- 5:15Pattern Matching
- 6:13Types
- 6:50Modifiers
- 7:26PNG
- 8:28PNG signature
- 9:36Executables
- 11:41Version
- 12:18AB Version
- 13:23Conversion
- 14:17Read Else
- 16:14Socket API
- 17:36Overview
- 18:48Example
- 22:07Generic vs Specific
- 24:23Gen Server
- 24:45Stack
- 28:45Flow Diagram
- 29:30Connection Packet
- 30:16Connection Version
- 30:44Parse Version
- 32:19Response Packet
- 34:29Integer
- 35:13Datatypes
- 36:21Capabilities
- 38:12Client Protocol 41
- 39:28Packets
- 40:40DV Connections
- 43:24Connect API
- 45:54API
- 47:41Book
related talks
49mBuilding a MySQL Database Driver in Elixir
37mBuilding Database Applications with Database/SQL
30mDriving Innovation in MySQL with Extensions
26mScaling MySQL with Python
17mFast database interfacing with MySQL.jl
45mdatabase/sql: the bad, the good and the ugly — developing a driver for YDB
43mOptimizing MySQL without SQL or touching my.cnf
41mElixir and Money
