Look, when you launch a project on Salesforce Commerce Cloud B2C, there are always challenges. If it’s a migration project, then you have to move users and data—data migration is always tricky. Making sure the new site performs well is another challenge. Pages need to load fast. And especially in Salesforce, managing quotas is a big deal.
Let me explain why quotas are such a challenge, especially during a go-live. I’m sure many of you have gone through this and will relate to what I’m about to share.
When we work in development environments, we’re usually connected to test systems. We use test catalogs, test promotions, test data in general. We try to cover all possible cases and start building the site from there. I guess most people work this way.
But what happens when we go live?
Well, our production environment connects to other production systems. That means real data, and most importantly, a real volume of data.
That’s when we really need to make sure we’re within Salesforce’s quotas.
In our most recent go-live, we hit a quota issue related to the number of active promotions. The maximum allowed is around 1,000, and we had 1,041 active promotions. All alarms went off.
Luckily, this quota wasn’t enforced. That means the system kept working even though we had gone over the limit. Salesforce uses this type of quota to say: “From here on, performance may not be optimal.” So ideally, we should stay under that number to keep everything running smoothly.
We started reviewing which promotions we could deactivate. It was a warning sign.
But then another problem came up—also related to promotions—because of how SFRA works in category pages.
If you check the SFRA source code, you’ll see it uses a kind of cache to fetch active promotions linked to the products shown in that category. To avoid repeating those queries, it stores this cache in a session variable.
Here’s the catch: there’s a quota on how many characters you can store in a session string variable. The limit is 2,000 characters. And because we had so many active promotions, our system went over that.
This time, the quota was enforced. As a result, product listings on category pages stopped showing up completely.
So, what’s the lesson here?
Always be careful when going live. Whenever possible, test things with real data and real data volumes. That’s how you make sure your system will run smoothly within Salesforce Commerce Cloud’s limits and quotas.
Now, for the curious minds out there: how did we fix it?
We rewrote the function that used the session variable and switched to using the cache manager instead. We created custom caches in Salesforce to store that data, and that solved the problem. Products started showing again on the category pages, and we were back in business.