Performance & Memory Management
Ingestion connectors run inside containers with fixed memory limits. Failing to handle pagination, memory cleanup, or resource management causes silent data loss or OOM crashes in production. These are the most critical patterns to follow.Pagination (Required)
Every client method that fetches a list of entities from a REST API must implement pagination if the API supports it. Missing pagination is the most dangerous bug in connectors — it silently returns only the first page of results with no error.Lookup Optimization
When you need to look up entities by ID or path during iteration, build a dictionary once and use O(1) lookups — don’t iterate a list every time.Memory Management
Connectors that read files (storage connectors especially) or process large query results must manage memory carefully to avoid OOM:- Never load entire files without a size check:
- Delete large objects after processing and call
gc.collect():
- Use generators in yield methods — don’t accumulate results in a list:
- Bound all caches — use
lru_cache(maxsize=)or clear between scopes:
- Stream query results — use
.fetchmany(), not.all()on large tables:
Connection Reuse
REST clients should create onerequests.Session and reuse it for all requests:
Next Step
With the Code ready to go, we can now proceed to make a small change in the UI to be able to configure the Connector properly from there.Apply the UI Changes
Learn what you need to do to be able see the Connector properly in the UI