Where to put business logic: business rule vs client script vs plug-in vs cloud flow

Verdict: Enforce simple validation everywhere with a table business rule. Give immediate pre-save feedback in client script. Use a synchronous plug-in when a failure must roll back the triggering write. Reserve cloud flows for post-commit automation.

CriterionBusiness ruleClient scriptSynchronous plug-inAsynchronous plug-inCloud flow
Runs whereTable level, client and serverBrowser, one app onlyServer, in-transactionServer, system job queueServer, after commit
Enforced across form, Web API and flowYes, all access pathsNo, only its own appYesYesYes, but reactive
Rolls back the triggering writen/an/aYes, shares the transactionNo, runs outside itNo, runs outside it
Immediate pre-save feedbackNoYesNo, runs on saveNoNo, after commit
First choice forSimple validation for non-developersIn-form UX before saveHard transactional consistencySlow or non-critical follow-upDeclarative post-commit automation

Rules

Traps