Discovery & Loyalty Platform
PHP monolith with static feeds → serverless discovery on Lambda, DynamoDB, and GraphQL; 3x throughput, +18% CTR and +22% DAU via Amazon Personalize.
- Role
- Senior Software Engineer
- Context
- Discovery / Loyalty (Indonesia)
- Duration
- Part of the 2022 to 2023 Imaginato engagement
- Team
- Senior engineer (me) + product and data partners
Tech stack
- AWS Lambda
- DynamoDB
- GraphQL
- Amazon Personalize
- Node.js
- API Gateway
- EventBridge
- S3
Business problem and production context.
Business problem
Qraved's discovery and loyalty product ran on a PHP monolith that could not keep up with catalog growth or personalized feeds. Recommendations were static, infra cost scaled faster than traffic, and engagement metrics had plateaued.
Architecture decision
Migrated the read-heavy services to serverless on Lambda, DynamoDB, and a GraphQL API, then wired Amazon Personalize into the discovery feed and loyalty prompts. Personalization ran off event streams so recommendations updated with real user behavior instead of nightly batches.
AWS production path
Reference architecture Rahul reviews before changing services.
ap-south-1 · us-east-1
AWS Account / prod
Region-aware · explicit failure, cost, and rollback controls
Edge and API ingress
public boundaryRoute 53
DNS + health checks
CloudFront
edge cache
AWS WAF
request filtering
API Gateway
public API boundary
Private workload boundary
blast radius visibleLambda
sync handler
SQS
buffer + retries
Lambda
worker
DynamoDB
state + access pattern
GenAI and data services
retrieval + cost pathBedrock
model call
OpenSearch
vector / keyword search
ElastiCache
semantic cache
Control plane
cross-cuttingHigh availability
Multi-AZ, health checks, graceful failover
Data durability
Encrypted state, point-in-time recovery, backups
Security
IAM least-privilege, KMS, WAF, secret rotation
Observability
Logs, metrics, traces, alarm budgets
Automation
IaC, deploy pipelines, rollback in <30s
Cost control
Budgets, caching, tiered storage, idle off
The useful proof is the decision surface, not only the result number.
These are the parts of the work that show production judgment: ownership, constraints, rollback, cost, and observability.
Owned scope
- Production architecture review, implementation sequencing, and operational handoff
Evidence artifacts
What would fail first?
Every project has constraints. The useful work is naming them early enough that rollback, cost, and ownership are designed before an incident.
Production risk
The work needed explicit decisions around cost, reliability, rollback, and ownership.
Trade-offs accepted on purpose.
Production risks and how they were controlled.
Small steps, visible changes, fewer surprises.
- 01
Mapped the monolith's discovery and loyalty flows, isolating the read-heavy feed and reward endpoints that drove most of the load.
- 02
Stood up a GraphQL API in front of Lambda resolvers backed by DynamoDB single-table access patterns for predictable latency.
- 03
Streamed interaction events through EventBridge into Amazon Personalize so the recommendation model learned from live behavior.
- 04
Rolled personalization out behind a flag, comparing CTR and DAU against the static baseline before full cutover.
- 05
Added cost and quality guardrails so the personalization layer stayed within budget as traffic grew.
Before and after.
Rollback path
Changes were kept small enough to reverse and visible enough to debug.
Cost considerations
Cost drivers were reviewed against real usage rather than generic service advice.
Observability notes
Signals were tied to user impact, owner action, and the failure mode being controlled.
Related services
Have a similar production problem?
Send the current architecture, bill concern, deployment pain, or GenAI reliability issue. I will help you find the first real bottleneck.
Book a production review