crossplane-contrib / crossplane-contrib/provider-sql

Provider should use connection pooling or single transaction to minimize load on database when reconciling

Open
#195 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
154
Forks
119
Avg merge
6d 17h
Merged PRs (30d)
8

Description

### What problem are you facing?

If I have hundreds to thousands of objects to be reconciled, opening a new connection for each aspect (Privs,Perms,Connections) creates unnecessary load to the database instance and can exhaust available connections. Let's say that I had dozens to 100's of roles to reconcile, I would end up creating for each user:

1 connection for CREATE ROLE xxxx PASSWORD yyyyyy ppppp
1 connection for ALTER ROLE xxxxx PASSWORD yyyyy
1 connection for ALTER ROLE xxxxxx pppppp
1 connection for ALTER ROLE xxxxxx RESET ALL, and Configs in transaction block
1 connection for ALTER ROLE xxxxx CONNECTION LIMIT zzzzz

If the reconciler runs every 5 minutes, I would be churning thousands of connections per hour.

### How could Crossplane help solve your problem?

Implement role provider with connection pooling (standard golang bindings are fine) and/or use ExecTx for all elements of each user.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.