best-photographer-83931
02/20/2026, 4:28 PMwide-refrigerator-45896
02/25/2026, 2:06 PMpowerful-spoon-16837
02/25/2026, 3:48 PMAbstractStickyBucketService, it is entirely your responsibility to handle persistence. GrowthBook (including self-hosted instances) does not store or manage sticky bucket assignment data on the server side. The GrowthBook server provides the experiment configuration and rules, but the actual sticky bucket assignments are stored and retrieved through whatever service you implement. The Python SDK ships with InMemoryStickyBucketService, which is useful for testing but loses all data on process restart. For production, you'll want to implement your own subclass of AbstractStickyBucketService backed by a persistent store like Redis, PostgreSQL, DynamoDB, etc.
2. Communication between server-side and client-side SDKs
GrowthBook does not provide a built-in mechanism for server-side and client-side SDKs to exchange sticky bucket data directly. However, this is a well-supported pattern that you implement on your side using a shared storage layer.
The recommended approaches are:
- Cookies (most common): Your Python backend reads/writes sticky bucket data to cookies. On the client side, use BrowserCookieStickyBucketService. Since cookies are automatically sent with HTTP requests, both sides share the same data. Make sure to use the same cookie name prefix on both sides.
- Shared database / Redis: Your Python backend persists sticky buckets to a shared store (e.g., Redis). Then expose an API endpoint that serves the assignments to the client SDK, which can use them during initialization.
- Hybrid: You can wrap multiple strategies (cookies + Redis, etc.) in a custom AbstractStickyBucketService implementation.
The GrowthBook docs describe this pattern in the "Front-end and Back-end" example using the JS SDK with BrowserCookieStickyBucketService on the frontend and ExpressCookieStickyBucketService on the backend — the same principle applies to Python + any client-side SDK.
Hope this helps! Let me know if you have any further questions.best-photographer-83931
02/25/2026, 4:36 PM