Skip to content

Conversation

@gtema
Copy link
Collaborator

@gtema gtema commented Jan 5, 2026

There are lot of cases where it is necessary to determine the
domain_id by the user_id. Fetching the whole user is relatively
expensive due to the multiple table joins while the attribute itself is
present already on the main table entry. Implement a method that only
returns the domain_id attribute by the user_id. Since this data can
never change (unless somebody mess directly in the database) caching can
be implemented to further improve the performance (when
conf.identity.caching is true).

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

🐰 Bencher Report

Branchuser_domain_id
Testbedubuntu-latest
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
nanoseconds (ns)
(Result Δ%)
Upper Boundary
nanoseconds (ns)
(Limit %)
fernet token/project📈 view plot
🚷 view threshold
1,415.10 ns
(-3.31%)Baseline: 1,463.52 ns
1,548.18 ns
(91.40%)
get_fernet_token_timestamp/project📈 view plot
🚷 view threshold
147.71 ns
(-3.55%)Baseline: 153.14 ns
189.82 ns
(77.82%)
🐰 View full continuous benchmarking report in Bencher

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

🦢 Load Test Results

Goose Attack Report

Plan Overview

Action Started Stopped Elapsed Users
Increasing 26-01-05 14:17:17 26-01-05 14:17:19 00:00:02 0 → 4
Maintaining 26-01-05 14:17:19 26-01-05 14:17:49 00:00:30 4
Decreasing 26-01-05 14:17:49 26-01-05 14:17:49 00:00:00 0 ← 4

Request Metrics

Method Name # Requests # Fails Average (ms) Min (ms) Max (ms) RPS Failures/s
GET 9295 0 12.41 8 27 309.83 0.00
Aggregated 9295 0 12.41 8 27 309.83 0.00

Response Time Metrics

Method Name 50%ile (ms) 60%ile (ms) 70%ile (ms) 80%ile (ms) 90%ile (ms) 95%ile (ms) 99%ile (ms) 100%ile (ms)
GET 10 11 16 17 17 18 19 27
Aggregated 10 11 16 17 17 18 19 27

Status Code Metrics

Method Name Status Codes
GET 9,295 [200]
Aggregated 9,295 [200]

Transaction Metrics

Transaction # Times Run # Fails Average (ms) Min (ms) Max (ms) RPS Failures/s
ListUsers
0.0 0 0 0.00 0 0 0.00 0.00
0.1 5855 0 9.77 8 18 195.17 0.00
ValidateToken
1.0 0 0 0.00 0 0 0.00 0.00
1.1 3440 0 16.98 14 27 114.67 0.00
Aggregated 9295 0 12.41 8 27 309.83 0.00

Scenario Metrics

Transaction # Users # Times Run Average (ms) Min (ms) Max (ms) Scenarios/s Iterations
ListUsers 2 5854 9.77 8 18 195.13 2927.00
ValidateToken 2 3438 16.99 14 27 114.60 1719.00
Aggregated 4 9292 12.44 8 27 309.73 4646.00

Error Metrics

Method Name # Error

View full report

@gtema gtema force-pushed the user_domain_id branch 2 times, most recently from 15d243e to 6f6d2cb Compare January 5, 2026 13:56
There are lot of cases where it is necessary to determine the
`domain_id` by the `user_id`. Fetching the whole user is relatively
expensive due to the multiple table joins while the attribute itself is
present already on the main table entry. Implement a method that only
returns the `domain_id` attribute by the `user_id`. Since this data can
never change (unless somebody mess directly in the database) caching can
be implemented to further improve the performance (when
`conf.identity.caching` is true).
@gtema gtema merged commit 971db4b into main Jan 5, 2026
27 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants