Skip to content

Performance: Use "expands" on the User APIs, and review other APIs that may require many joins #2319

@robotdan

Description

@robotdan

Performance: Use "expands" on the User APIs, and review other APIs that may require many joins

Description

The User API in particular, and perhaps a few others perform a lot of joins to obtain the user registrations, group memberships, etc.

In may cases you don't need this information.

I like how the Stripe API does this with a concept called "expands".

This is mostly implemented for the User API, but we need to review how we can use this strategy or not - in the re-index code path that needs to use a cursor to stream the entire user table.

By default the User API has to be backwards compatible, so the expands will be enabled, but you will be able to optionally the call the API w/ an explicit expands disabled, to improve the performance of the API.

For many clients, the current performance is acceptable, but there are some edge cases where you have configured application roles through user registration and group memberships, and there are some extreme performance penalties when using our current strategy.

Related

Documentation

  • Document new API request expand parameter on User Search API
  • Document User Search API response property expandable.
  • Document how the alias will work in the Configuration reference so that end users know that we will use the configured index name as an alias for _a or _b indexes.
  • Update the Reindex API to describe how we are using an alias to get an _a and _b index.

Community guidelines

All issues filed in this repository must abide by the FusionAuth community guidelines.

Release Notes

Support for optional expansion of the user.registrations and user.memberships properties on the User Search API.
+
This change is backwards compatible, but you may optionally request the Search API omit these properties on the response which may improve performance. See the link:/docs/v1/tech/apis/users#search-for-users[User Search] API for additional details on using the expand request parameter, and the expandable response value.
+

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Delivered

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions