Database connection pooling middleware and API
