Prompt
ChatGPT: I’m moving some app logic closer to users. What should stay in the core backend, and what is a good candidate for the edge?
Latest observation
A good rule of thumb is:
- Core backend = anything that needs strong consistency, deep trust, or access to your full system of record.
- Edge = anything that benefits from low latency, geographic proximity, caching, or lightweight decisioning.
Keep in the core backend
These usually should not be pushed to the edge:
-
Source of truth data writes
Transactions, orders, payments, inventory changes, account updates. -
Authorization and sensitive policy decisions
Final permission checks, entitlements, billing status, tenant boundaries. -
Business-critical workflows
Anything that must be atomic, auditable, or strongly consistent. -
Data aggregation and canonical processing
Reconciliation, reporting pipelines, fraud models, billing calculations. -
Secrets and sensitive internal integrations
Access to databases, private services, partner APIs, secret keys. -
Complex stateful logic
Long-running workflows, orchestration, dependency-heavy operations.
Good candidates for the edge
These are often great to move outward:
-
Caching and read acceleration
Frequently read, mostly static, or semi-static content. -
Personalization at request time
Simple tailoring based on headers, geo, locale, device type, or session hints. -
Request routing / traffic steering
A/B tests, canary routing, region selection, bot filtering. -
Lightweight validation
Basic input checks, schema validation, throttling, rate limiting. -
Content transformation
Image resizing, HTML rewriting, response shaping, compression. -
Latency-sensitive read logic
Small computed responses that don’t require authoritative writes. -
Localized decisions with safe fallbacks
Geo-based content, language selection, edge feature flags.
A practical split
A useful pattern is:
- Edge handles “fast, local, reversible” work
- Core handles “authoritative, durable, sensitive” work
If the logic:
- must be correct even under rare race conditions,
- depends on many internal services,
- or updates durable state,
keep it in the backend.
If it:
- improves latency,
- can tolerate brief staleness,
- or can fail open to a safe default,
it’s a stronger edge candidate.
Examples
Better at the edge
- Redirecting users to the nearest region
- Serving cached product pages
- Adding geo-specific banners or language
- Rate limiting abusive clients
- Simple experiment bucketing
Better in the backend
- Charging a credit card
- Creating an order
- Computing final pricing with taxes/discounts
- Revoking access
- Updating inventory
Decision test
Ask these questions:
-
Does this change authoritative state?
If yes, keep it in core. -
Would inconsistency be harmful?
If yes, keep it in core. -
Can it be computed from request context alone?
If yes, edge may work. -
Is low latency more valuable than perfect freshness?
If yes, edge is a candidate. -
Can it safely fall back to the backend?
If yes, edge is a strong fit.
If you want, I can also help you classify a specific piece of logic you’re considering moving to the edge.