Uploaded image for project: 'Crowd Data Center'
  1. Crowd Data Center
  2. CWD-4908

Reduce write pressure on database when user authenticates

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Fixed
    • None
    • None
    • None
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      Currently Crowd performs some writes in the database when a user authenticates. In particular, it always updates the lastAuthenticated user attribute (in com.atlassian.crowd.directory.DbCachingRemoteDirectory#performAuthenticationAndUpdateAttributes and com.atlassian.crowd.manager.authentication.TokenAuthenticationManagerImpl#updateUserLastActivity).

      If a user authenticates with high frequency (e.g., via a REST API), that induces high write load in the database, typically to update a timestamp just by a few milliseconds.

      As an optimisation, Crowd could avoid those writes in case the old and the new timestamps are close enough (let's say 1 minute), as it already does for the token last-access time (see parameter lastAccessedTimeUpdateThresholdMillis in com.atlassian.crowd.dao.token.TokenDAOHibernate#update).

              mkempa Marcin Kempa
              dberrueta Diego Berrueta
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: