Unlocking the Secrets to Salesforce Design Mastery: Part I
Andrea Onhaus
Head of Consulting / Salesforce Partner | Business MBA Women in tech leader
Salesforce architecture: where dreams of seamless integrations and scalable systems meet the harsh reality of governor limits and the occasional SOQL bug.
Building a great Salesforce architecture is like being a chef with a wild kitchen – you have powerful tools and ingredients, but you also have to figure out how to create a gourmet dish with just 150 queries, a sprinkle of Flow, and a dash of Lightning Web Components.
In this blog, we’ll dive into the principles of Salesforce architecture design with Pere Marti – because while Salesforce may be a no-code/low-code platform, creating a robust system still requires high-code thinking and a solid strategy (and maybe a little caffeine).
When designing a solution for high user volume, what principles do you prioritize to ensure scalability and performance optimization?
The answer to this question is: limits, limits, limits!
As a Salesforce dev/admin/ you will quickly find out that Salesforce has limits for everything. This will be specially surprising if you come from a more traditional programming background where your limits are not so clear cut, specially in the cloud you can consume as much resources (memory, execution time, database space, …) as you want. If you don’t optimize, no problem, your application will still run. Your “limit” will be the big fat bill you will get at the end of the month from your cloud provider.
In Salesforce, the platform will enforce you to stay within certain limits, if you go over, your application will just crash. So for any solution, but specially for the ones that require performance and scalability, you always need to design and build it by taking limits into account.
领英推荐
Let me give you a few of the most typical cases (if you’ve been a while here you’ve seen some of them):
Just to be a bit more complete on my answer, to ensure a good performance on FE side you can use several of the caching features available in LWC, or lazy loading: only load the data or components that are immediately needed for display. https://developer.salesforce.com/docs/platform/lwc/guide/apex-result-caching.html
On the sharing side, for high-user volume you should always consider data skew: that is, when a single record has a very large number of child records associated with it, or when many users are associated with the same role or record. This can lead to performance degradation, especially during sharing recalculations triggered by changes in record ownership or sharing rules. Here is a more detailed explanation and some best practices to avoid it: https://www.salesforceben.com/data-skew-in-salesforce-why-it-matters/
Finally something much neglected, that you should consider specially for high-volume situations. Data archival and your archival strategy: Identify records that are no longer needed for daily operations (e.g., old opportunities, cases, or logs) and use an external archival solution or data warehouse to move these records outside of Salesforce.
For the full article follow the link . . . .