What architectural best practices govern scalable implementation of core Service Cloud solutions?
Answer
Basics: Service orgs run high volumes with strict SLAs, so every customization has performance and maintenance cost. Declarative features are supported, upgrade-safe and visible to admins. Code is for gaps, complex integrations and heavy processing. Workflow Rules and Process Builder are retired, so new automation belongs in Flow.
How it works: Recommended layering: (1) Data model: Account/Contact, Case, record types and support processes only where lifecycles differ. (2) Intake: Email-to-Case, Messaging, web-to-case with pre-chat data. (3) Routing: assignment rules or Omni-Channel flows with queues and skills. (4) SLA: entitlements, milestones, business hours. (5) Resolution: Knowledge, macros, Quick Text, screen flows. (6) Reporting: dashboards and CRM Analytics. (7) Extensibility: LWCs and Apex.
Advanced / deep dive: Governance matters: one automation owner per object, with a documented order of execution; avoid mixing record-triggered Flows and triggers that update the same fields. Use one trigger per object with a handler class and a bypass switch. Sharing: set Case OWD to Private or Public Read Only, avoid owner skew (a single user or queue owning over about 10,000 records can slow sharing recalculation), and keep queue and group structures simple. Large data volumes: index and selective filters in list views and reports, archive old cases (Big Objects, external storage or a platform archive product), and avoid non-selective queries. Performance: keep Lightning record pages lean, use dynamic forms and conditional visibility, and test with the Lightning page analyzer. Environment: use scratch orgs or sandboxes with CI/CD, test classes with bulk data (200 records), and monitor with Event Monitoring or Optimizer. Use Salesforce Well-Architected guidance for trade-offs.
Code / config example:
trigger CaseTrigger on Case (before insert, before update, after insert, after update) {
if (TriggerBypass.isBypassed('Case')) return; // custom setting or static flag
CaseTriggerHandler.run(Trigger.operationType, Trigger.new, Trigger.oldMap);
}
Hidden gotchas & must-remember points:
- Only one assignment rule and one escalation rule can be active per object at a time.
- Flows and triggers on the same object fire in a defined order; undocumented overlap causes recursion and overwrites.
- Ownership skew and queue-heavy assignment slow sharing recalculation at scale.
- Reports on millions of cases need selective filters, or they time out.
- Workflow Rules and Process Builder are retired; migrate to Flow.
- Over-customized page layouts per record type multiply testing and maintenance.
Best practice: Default to declarative, document every automation, and review each custom code request against whether a supported feature already solves it.