Implement a Quota Policy with no-reset

Hi,

If I set a Quota Policy of

Allowed Count: 10

Interval: 1

TimeUnit: Minute

The Quota Policy by default will allow only 10 calls per minute. As soon as the 2nd minute starts the quota resets and the developer can again make 10 calls a minute.

My use case is a bit different.

I would like to set an overall Quota on my endpoints for a year and once the quota/duration gets over. The quota should not get reset,it should just give an error as quota exceeded.

Q1. How to implement a yearly quota?

Q2. How do implement a non-resetting quota policy?

0 5 231
5 REPLIES 5

I am not sure of the limits of the Quota policy, but I *believe* that the time unit can not be so large as a year.

If you want to do this, you might consider managing your quota in an external database. That's what I would do.

@Dino-at-Google

read operation for every request - would not be very cost-effective.

How you design your Quota is up to you. It need not read a disk for every request. (Apigee's quota doesn't)

The problem with a full year Quota is that it doesn't scale very well when you have thousands or millions of buckets being added daily.

@Dino-at-Google Just curious - What will happen If we configure Allow Count = 10, Interval = 12 and TimeUnit=month.

Not applicable

As per the document, it allows a quota maximum of a month time unit.