xWeb Performance Authorization

Performance tune the Authenticate web method and its internal ValidateToken method, which validates a token and loads xWeb User data for each web method call. Convert inline Transact SQL into a Stored Procedure (SP) with output parameters. Consolidate series of separate SQL commands into a single Stored Procedure to reduce server round-trips.

  • Authenticate: write new ws_authenticate_user SP. In all, it reduces the separate SQL commands from seven to two.
  • ValidateToken: write new ws_GetFailFaultCounts SP. Add new ws_exchange_token SP to replace two existing SPs (ws_validate_token and ws_update_token) and one inline T-SQL command that selected information about the xWeb user. Eliminate an unneeded command to load system options if they are already loaded. In all, reduce the multiple commands to a single command.

    Add AuthenticationTokenCachingPolicy configuration option to manage authentication Tokens in server memory cache instead of in database tables. This option can provide better speed and performance under very high load.

  • GetQuery web method code base: Convert all real-time SQL recordset commands into cached recordset commands that implement the CachedDataReader class. This modification eliminates SQL commands to the SQL server to reduce network traffic between the web and SQL server and reduces load on the SQL server, all of which results in a faster web method call.

    Modify engine query code to allow for xWeb to cache metadata on certain relatively static SQL commands to further minimize SQL commands.