Resource and Cost Optimization — Patterns

The Resource and Cost Optimization pillar focuses on efficient architecture, code quality, and optimal resource utilization to maximize platform capabilities, together with governance and cost awareness to align spend with the business value delivered. These patterns turn the pillar’s design principles into concrete, reviewable practices: what to look for in a solution, what good looks like, and the anti-patterns that undermine it.

These patterns put the Resource and Cost Optimization pillar’s design principles into practice. Read them alongside the Resource and Cost Optimization pillar for the full guidance behind each one.

  • Optimize for total cost of ownership — evaluate decisions across the full lifetime cost, not short-term cost minimization.
  • Align spend with business value — connect every investment to a measurable business outcome so you can spot spend that no longer earns its return.
  • Design within platform limits — treat governor limits as architectural constraints embraced from initial design, with margin for growth.
  • Optimize the resources you already pay for — maximize the throughput and efficiency of provisioned assets before buying more capacity.
  • Right-size licensing and consumption to actual use — match each user to the license their work requires and design automations to invoke metered services efficiently.
  • Establish financial governance and cost-aware culture — bring cost-benefit analysis into design decisions as a shared responsibility, not an after-deployment discovery.
  • Practice continuous optimization — monitor spending and consumption continuously, because waste accumulates gradually and priorities evolve.

Each category pairs patterns (what good looks like) with anti-patterns (what to avoid), organized so you can review a solution area by area. Start from the optimization outcome you need:

  • Designing an efficient solution shape? Use Architecture for scalable architecture, data model design, and integration efficiency.
  • Tightening the code itself? Use Code Quality for bulkification, governor limit optimization, and performance best practices.
  • Controlling license spend? Use License Management for license optimization, user assignment, and entitlement management.
  • Reducing storage and API consumption? Use Storage and API Optimization for data archival, storage efficiency, and API call reduction.
  • Establishing cost oversight? Use Governance for cost tracking, budget controls, usage monitoring, and build-vs-buy decisions.
  • Operating agents in production? Use Agentic Patterns for token efficiency, model selection, credit consumption, and agent cost monitoring.

Resource and cost optimization patterns for agentic systems including token efficiency, model selection, agent resource management, credit consumption, TCO modeling, and agent cost monitoring.

Patterns for scalable architecture, data model design, integration efficiency, and system optimization.

Patterns for efficient code, bulkification, governor limit optimization, and performance best practices.

Patterns for license optimization, user assignment, feature licensing, and entitlement management.

Patterns for data archival, storage efficiency, API call reduction, and integration optimization.

Patterns for cost tracking, budget controls, usage monitoring, cost allocation, and build vs buy decisions.