server-connection-python
Installation
SKILL.md
Couchbase SDK Connection Management — Python
Platform-agnostic concepts (connection string formats, timeout semantics, durability, sub-document, troubleshooting):
shared/server/sdk-connection-concepts.md
The One Rule: One Cluster Per Process
Create one Cluster object per application process and reuse it for the lifetime of the application. Creating a new Cluster per request pays TCP + TLS + auth overhead (50–500ms) and leaks connections.
Singleton Pattern
import os
from datetime import timedelta
from couchbase.cluster import Cluster
from couchbase.options import ClusterOptions, ClusterTimeoutOptions
from couchbase.auth import PasswordAuthenticator