Hello, I was considering to use GrowthBook cloud ...
# ask-questions
b
Hello, I was considering to use GrowthBook cloud but noticed the 10M/month API calls cap I want to evaluate how many clients this can handle so I know to switch to self hosting and if a caching strategy helps when does the SDK query the cloud instance and when does it use cache (proxy, SDK Redis cache)? say I have 500,000 active users a month interacting over a stack composed of a nextJS React client nextJS Vercle API functions EC2 instance backend app say for every user they will load the app then user attributes are set then navigate to a page where anther user attribute is set (we use the growth book proxy) A Vercel API function is called once on both pages and another is called on the second page ( ā€¢ total calls 3, 2 on the same function, 1 a different, both share Upstash Redis cache The Vercel API functions all call the same backend service, but the load balancer distributed the 3 API calls 2 on the same pod and 1 to another (we use a shared Redis) If for example these 200K of these 500K uses are active for 10 days of the month the rest visiting once does hosting a proxy help in reducing api calls by the react app (assuming no server side)? does a shared Redis (say using up-stash) reduce API calls for the Vercel functions or will it load every-time? does a shared Redis help for the EC2 instance? Will I be able to start off in cloud then switch to self-hosted later? If I don't care about PII can I skip out on using the proxy?
f
Hi Amr: Depending on the SDK, it does do caching. For the JS/React SDK the number of requests should be roughly equal to the number of sessions you have, but if you use a proxy, it will do much heavier caching. If you use the real time updates, that will also increase the number of calls. Yes, you can switch from cloud to self-hosting (or vice versa) Yes, the proxy is not required
b
so it looks like to save time and maintenance I should use cloud without
subscribeToChanges
If I set it to false, will users still get feature updates? or will it happen on the next time they visit the site (refresh), or when a user attribute updated ? I wonder I I can then flag a group of users to have more live updates šŸ¤” Is there any place in the account where I can get your SLOs? or a sense of how much load you have ? I can report it in my logging tools to compose an alarm when I'm over using your API or warn me if there are issues
r
When ā€‹`subscribeToChanges`ā€‹ is set to ā€‹`false`ā€‹, the GrowthBook SDK will not subscribe to live updates for feature flag changes that are made in the GrowthBook UI. Instead, the feature flag values will be fetched based on the cache settings or when the ā€‹`loadFeatures()`ā€‹ method is called manually from within your application code. For more details on how to manage feature flag updates and the use of ā€‹`subscribeToChanges`ā€‹, you can refer to the GrowthBook documentation on ā€‹*streaming updates*ā€‹.
Which SLO(s) are you interested in? We serve double-digit billions of feature requests per month with 99.99% uptime. So 10M requests/month is not a problem at all. Something to note is that we don't currently have an API endpoint for fetching how many API requests you've already used and how many you have left. If this is something you want to track you would need to manage that yourself. It's on our roadmap to build this in the future.
It is possible to enable real-time updates for only certain visitors, since each visitor gets their own GrowthBook instance via the SDK. You would have to make the settings visitor-specific within your application code.
b
thanks @brief-honey-45610
šŸ‘ 1