Salesforce Lightning Web Components (LWC) represents a fundamental shift in how controller logic is distributed. By moving the controller to the client side, LWC achieves responsiveness—but introduces a category of risks that are easy to overlook during development and expensive to discover in production.
The fundamental tradeoff. In a traditional server-rendered architecture, the controller owns the truth. The view is a projection of server state. In LWC, the controller runs in the browser, which means the source of truth must be synchronized across network boundaries. Every @wire call, every imperative Apex invocation, every cache refresh introduces a window where client state and server state diverge.
This divergence is not theoretical. We have seen production incidents where client-side controllers processed stale data because the @wire cache had not yet refreshed after a DML operation. The error did not throw—it simply produced the wrong result silently. In regulated environments, silent errors of this kind are particularly dangerous because they violate the audit trail without triggering any alert.
Security implications. Client-side controllers must validate data before dispatching it to Apex, but JavaScript validation is inherently visible to the end user. Any business rule enforced only on the client can be bypassed with browser developer tools. For organizations subject to EU data protection regulations or U.S. federal compliance requirements, this means every client-side validation must be paired with a server-side enforcement layer—which effectively means maintaining two controller implementations.
Recommendations. Treat LWC controllers as view-layer conveniences, not as authoritative business logic. Every mutation should flow through a single Apex entry point that validates, transforms, and persists. The client controller should optimize for user experience—optimistic updates, debounced refreshes, graceful fallbacks—but never for data integrity.
In our practice, this separation has proven essential for clients operating under government contract compliance regimes, where the integrity of record modifications must be demonstrable after the fact.

