Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/configcat/docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sigewuzhere committed Feb 20, 2020
2 parents 7e407db + fbae52e commit f778be7
Showing 1 changed file with 26 additions and 23 deletions.
49 changes: 26 additions & 23 deletions docs/requests.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ id: requests
title: About requests
---

At ConfigCat we only limit the requests which are sent to the ConfigCat servers from your applications.
We don't limit on MAUs (Monthly Active Users) or any other fictional measurements which are hard to predict or calculate.
At ConfigCat we have a soft limit on the number of requests which are sent to the ConfigCat servers from your applications. At the same time, we don't limit MAUs (Monthly Active Users) or any other fictional measurements which are hard to predict or calculate.

Check out our <a href="https://configcat.com/Home/Architecture" target="_blank">architectural overview</a>.

Expand All @@ -16,39 +15,43 @@ Check out our <a href="https://configcat.com/Home/Architecture" target="_blank">
| **Unlimited** | 250,000,000 | ~100 |
| **Dedicated** | 5,000,000,000 | ~2000 |

> If you hit this limit we will keep your application up and running. However you can expect us contacting you on how we can meet your needs.
> If you hit this limit, we will keep your application up and running. However, you can expect us contacting you on how we can meet your needs.
## What is a request?
The ConfigCat SDKs - which you build in your application - download your feature flags and settings in the
from of a config.json from the ConfigCat servers and caches it locally. One config.json download as 1 request.
The ConfigCat SDKs - which you import into your applications - download your feature flags and settings in the
form of a config.json from the ConfigCat servers and cache it locally. One config.json download counts as 1 request.

## What is NOT a request?
Accessing feature flag and setting values are served from local cache and are not considered to be requests. You can
call `GetValue()` as many times as you like. These calls are always evaluated locally.
Reading feature flag and setting values from the cache is not considered a request.
You can call `GetValue()` as many times as you like.
These calls are always evaluated locally.

## About caching
There are 3 different ways (polling modes) to control caching.

Check out this animation explaining polling modes:
This animation explains the different polling modes:

<iframe width="800" height="490" src="https://www.youtube.com/embed/_LWPjR4_GqA" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

### Auto polling (default)
In auto polling mode the ConfigCat SDK downloads the latest values and stores them automatically. This is done in every 60 seconds by default. You can
set it to any number between 1 sec and int max.
In auto polling mode, the ConfigCat SDK downloads the latest values automatically and stores them in the cache.
This is done in every 60 seconds by default.
You can set the polling interval to any number between 1 second and int max.
### Lazy loading
In lazy loading mode the ConfigCat SDK downloads the latest setting values only if they are not present or expired in the cache. You can set the cache Time To Leave
(TTL) to any number also.
In lazy loading mode, the ConfigCat SDK downloads the latest setting values only if they are not present in the cache, or if the cache has expired.
You can set the cache Time To Leave (TTL) to any number also.
### Manual polling
Manual polling gives you full control over when the setting values are downloaded. ConfigCat SDK will not update them automatically. You have to update the cache
manually by calling a `forceRefresh()`.
Manual polling gives you full control over when the setting values are downloaded.
The ConfigCat SDK will not update them automatically.
You can (and should) update the cache manually, by calling a `forceRefresh()` - this will download the latest values and update the cache.
#### Webhooks
Additionally there are Webhooks available to et notified about changes instantly. [Read more about Webhooks.](advanced/notifications-webhooks.md)
Additionally, there are Webhooks available to get notified about changes instantly.
[Read more about Webhooks.](advanced/notifications-webhooks.md)

# Requests explained via live examples
# Requests explained through examples

### Backend
Backend applications typically have a lower number of instances than on frontend.
Backend applications typically have a lower number of instances than frontend applications.

#### Example 1 - average polling with 4 instances
Let’s say you have an API for your frontend application and you have 4 instances of them behind a load balancer.
Expand All @@ -63,18 +66,18 @@ the default polling interval down to 1 seconds. In this case we are calculating
> **10** *(instances)* * **2,592,000** *(seconds in a month)* = **25,920,000 requests / month**
### Frontend/mobile/desktop applications
Frontend/mobile/desktop applications are usually running in lots of instances determined by your users count.
Typically, you have a high number of frontend/mobile/desktop application instances. Their number is determined by your user count.

#### Example 3 - a web app with 15,000 users
Since the web app runs in the browser, there is a different ConfigCat SDK instance running for every user.
Having 15,000 active users who usually spend 5 hours on your web application per month.
The ConfigCat SDK is set to Auto polling with 60 seconds polling interval.
Web apps run in the browser, so for each user there will be a different ConfigCat SDK instance running.
In this example, we have 15,000 active users who usually spend 5 hours on your web application per month.
The ConfigCat SDK is set to Auto polling mode with 60 seconds polling interval.

> **18,000** *(5 hours in seconds)* / **60** *polling interval* = **300 requests/user/month**
> **15,000** *(users)* * **300** *(requests/user/month)* = **4,500,000 requests / month**
#### Example 4 - a mobile app
Having a mobile app which runs on the devices as a background process. The ConfigCat SDK is set to Auto polling with 1 hour polling interval.
Having a mobile app which runs on the devices as a background process. The ConfigCat SDK is set to Auto polling mode with 1 hour polling interval.
Your application runs on 5,000 devices.

> **5,000** *(devices)* * **730** *(hours in a month)* = **3,650,000 requests / month**
> **5,000** *(devices)* * **730** *(hours in a month)* = **3,650,000 requests / month**

0 comments on commit f778be7

Please sign in to comment.