Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The core of this feature is a new table listing all of the calls that will be throttled.

 

Code Block
languagesql
CREATE TABLE 'THROTTLED_CALLS'(
	'THROTTLE_ID' bigint PRIMARY KEY,

...

NORMALIZED_API varchar(256) uniqueness constraint

MAX_LOCKS(INT)

...

 --id of the throttle rule
	'NORMALIZED_CALL' varchar(256), --normalized api URL, numbers such as {id} replaced with #
	'MAX_LOCKS' int NOT NULL,
	'LOCK_TIMEOUT_SECONDS' int NOT NULL,
	'THROTTLE_EXPIRATION' bigint ,
	UNIQUE ('NORMALIZED_CALL')
)

EXPIRATION

This table would contain the api calls that administrators would want to throttle, the maximum number of calls per period, and the period of time after which the max calls would reset.

UserThrottleFilter will have a in-memory cached version of this table. It would periodically check the THROTTLED_CALLS table and update its cached version to reflect the information in the database.

...