-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQL Backend #11048
SQL Backend #11048
Conversation
9781645
to
f4750d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preliminary review, I need to dig deeper into backend stuff to properly review that.
581e651
to
9bc6013
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disclaimer: I have had no prior experience with SQL. I did a small amount of background reading on SQL concurrency in order to review this PR, but take everything with a grain of salt.
Addresses: #11048 (comment)
Latest changes include an optimization for the DeleteItems query. Previous query: teleport/lib/backend/postgres/tx.go Lines 133 to 137 in 1abf0b6
New query: teleport/lib/backend/postgres/tx.go Lines 134 to 141 in ce456d8
Performance improved from 7 minutes to 76 ms on a 300K record dataset (100K per table).
|
@smallinsky @Tener Could you please give this another look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have little prior experience with SQL but the code LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell it looks good.
One thought that I have is that given the multitude of backends that we have we could benefit from having a comprehensive backend test suite testing backend correctness and performance. Preferably an automated or semi-automated one.
We do! The test suite was very helpful when putting this together, especially by validating the correct error is returned from specific backend functions. I was able to iterate very quickly in the end because of this. teleport/lib/backend/sqlbk/test.go Line 70 in 3175fb1
teleport/lib/backend/test/suite.go Lines 105 to 112 in 3175fb1
|
This is good stuff, thanks for pointing that out. We could go bigger still with the tests to get a sense of the relative speed of individual backends under production-like loads... but this is probably just my inner benchmark junkie speaking 😉 |
Remove migration from backend API (#10835) The Migrate method on the Backend interface was not implemented by any backends. Migration should be implemented in the New method of backends so they can be sure migration happens before any background processes are started. Backport SQL Backend to v9 Original PR: #11048 Add a new backend supporting PostgreSQL and CockroachDB. Implements #10253 without cloud connectivity.
Documentation for SQL Backend #11048.
Documentation for SQL Backend #11048.
This reverts commit 06fef2a.
This reverts commit 06fef2a.
This PR implements a new backend supporting PostgreSQL and CockroachDB SQL database platforms.
Implements #10253 without cloud connectivity.