Serverless Cost Modelling, Quotas आणि Service Limits सोप्या भाषेत
Serverless स्वस्त वाटते — loop/fan-out/log retention महाग. 1x व 10x cost (USD+INR), quotas, concurrency headroom — launch आधी.
या chapter मध्ये तुम्ही काय शिकाल
- Cost model
- Quotas
- Budget alarm
- Runaway
- Pricing links
1. रोजचे: Rohan bill
Rohan (INR) webhook. Partner retry loop + fat logs = Monday bill.
Logs/metrics: CloudWatch; compute: Lambda; bills: Cost Explorer.
2. का model?
हे का लागतं?
Pay-per-use = चांगले design. Quotas = soft walls. Model = honest traffic.
हे काय आहे?
Cost = units x price. Quotas = limits. Reserved concurrency = critical protect.
3. Vertical diagram
4. How: model
कसं करायचं (step by step)
| Line | Unit | Watch |
|---|---|---|
| Invoke | Req/mo | Retry double |
| Duration | GB-s | Memory high |
| API | HTTP | Chatty |
| DDB | RCU/WCU | Hot+scan |
| Logs | GB | Debug prod |
| X-Ray | Segments | 100% sample |
5. Commands
Lambda account
aws lambda get-account-settings --region ap-south-1
अर्थ: Unreserved concurrency पाहा.
Quotas
aws service-quotas list-service-quotas --region ap-south-1 \
--service-code lambda --query 'Quotas[?contains(QuotaName, `Concurrent`)].{N:QuotaName,V:Value}' --output table
अर्थ: Black Friday आधी concurrent quota.
CE get-cost
aws ce get-cost-and-usage --time-period Start=2026-10-01,End=2026-11-01 \
--granularity MONTHLY --metrics UnblendedCost \
--group-by Type=DIMENSION,Key=SERVICE --query 'ResultsByTime[0].Groups[:5]'
अर्थ: CE एकदा enable — मग CLI.
Log retention
aws logs describe-log-groups --region ap-south-1 \
--query 'logGroups[?retentionInDays==`null`].logGroupName' --output text | head
अर्थ: null retention = forever bill.
6. Runaways
- Self-trigger loop.
- Visibility storm.
- No backoff.
- Fat DEBUG.
- Idle provisioned.
7. Industries
- Fintech budget.
- Ecommerce 10x.
- Media GB-s.
- SaaS tags.
- IoT storms.
8. Lab
9. Lab - model
Org block नसेल तर ap-south-1 (Mumbai). आधी budget alert.
कसं करायचं (step by step)
- 1x/10x estimate.
- Account settings.
- Null retention.
- Budget alert.
Cleanup (billing थांबवा)
- Cleanup budget.
- No silent prod.
10. एकाच pattern — वेगवेगळ्या industries
- Fintech (Aisha, Lagos): payment webhooks → SQS → Lambda.
- Ecommerce (Rohan, Pune): checkout API; inventory SNS fan-out.
- Healthcare (Mei, Singapore): SNS SMS; PHI + fine-grained IAM.
- EdTech (Diego, São Paulo): EventBridge nightly cleanup.
- Logistics (Fatima, Casablanca): EventBridge + saga.
- Media (Kenji, Osaka): S3 → Lambda thumbs + fan-out.
- SaaS (Priya, Bengaluru): Cognito + per-tenant partition.
- Gov (Omar, Amman): strangler fig per form route.
11. Troubleshooting checklist
- Region confirm करा.
- CloudWatch Logs + request id.
- Execution role permissions.
- DLQ + oldest message age.
- curl -v + CORS.
- SFN event history.
- Linked chapter पुन्हा वाचा.
- Cost: concurrency/retries.
12. सामान्य errors आणि fixes
प्रत्येक row = खरी चूक. Panic करण्याआधी fix वाचा.
| Error / लक्षण | Fix |
|---|---|
| Free forever | Model real. |
| No budget | Budgets+SNS. |
| Concurrency wall | Quota+reserve. |
| Forever logs | Set retention. |
| Fat memory | Right-size. |
| Retry blind | Count retries. |
| DDB surprise | Watch capacity. |
| Over-trace | Sample. |
| Currency | USD+INR. |
13. FAQ
प्र. Always cheaper?
Model both.
प्र. Reserved?
Cap+protect.
प्र. Quotas where?
Service Quotas.
प्र. CW link?
CW chapter.
प्र. Provisioned?
Pay for warm.
14. Interview Q&A (Beginner / Mid / Senior + MNC)
प्र. Beginner bill
Invoke+GB-s+logs.
प्र. Quota
Limit.
प्र. Mid estimate
1x/10x.
प्र. Runaway
Spike+cycle.
प्र. Senior cost
Tags+CUR.
प्र. MNC
Budgets+quotas.
15. Tips — English, मराठी आणि हिंदी
Ravindra Bagale's Tip (EN)
Model 1x and 10x, set a budget alarm, leave concurrency headroom — then ship.
Ravindra Bagale's Tip (MR)
1x/10x model, budget alarm, concurrency headroom — मग ship.
Tip (HI)
1x/10x model, budget alarm, concurrency headroom — फिर ship।
घरी करून बघा
- Estimate invokes.
- Account settings.
थोडक्यात सांगायचं तर
- गोष्टी पासून सुरू, मग services.
- Existing chapters link — labs copy नको.
- Failure साठी design.
- Measure → मग पैसे.
16. Architecture decision checklist
- User journey 5 bullets, no AWS names.
- Sync vs async mark.
- Failure mode.
- Idempotency key.
- Data from access patterns.
- Cost 1x and 10x.
- Quotas ap-south-1.
- Auth decision.
- On-call + alarm.
- Deep chapter link.
- मग console/IaC.
17. Copy-paste quick commands
# Region and identity
aws configure get region
aws sts get-caller-identity
# Lambda landscape
aws lambda list-functions --region ap-south-1 --max-items 20 \
--query 'Functions[].{N:FunctionName,R:Runtime,T:Timeout,M:MemorySize}' --output table
aws lambda get-account-settings --region ap-south-1
# API Gateway (HTTP APIs)
aws apigatewayv2 get-apis --region ap-south-1 --query 'Items[].{N:Name,Id:ApiId,Ep:ProtocolType}' --output table
# Queues and topics
aws sqs list-queues --region ap-south-1
aws sns list-topics --region ap-south-1 --query 'Topics[].TopicArn'
# Event buses and state machines
aws events list-event-buses --region ap-south-1
aws stepfunctions list-state-machines --region ap-south-1 --query 'stateMachines[].name'
# DynamoDB tables (names only)
aws dynamodb list-tables --region ap-south-1
Sandbox + read-only IAM.
18. अजून industry आणि stack stories
- Fintech Lagos: webhook → SQS → idempotent ledger.
- Ecommerce Pune: throttle + fan-out.
- Healthcare SG: SNS + PHI IAM.
- EdTech: EventBridge cleanup.
- Logistics: bus + saga.
- Media: avoid recursive S3.
- SaaS: tenant partition.
- Gov: strangler peel.
- Startup: Function URL → HTTP API.
- Retail: FIFO vs Standard.
- Python: thin handlers.
- Node: async/await.
- Java: SnapStart.
- .NET: package size.
- Go: static binary.
- PHP: hybrid.
19. Glossary
| Term | अर्थ |
|---|---|
| Cold start | पहिल्या invoke ची init |
| Idempotency | दोनदा = तोच effect |
| DLQ | Fail झालेले messages |
| Choreography | Events; conductor नाही |
| Orchestration | SFN central |
| Fan-out | एक → अनेक |
| Fan-in | अनेक → join |
| Strangler fig | Monolith peel |
| Saga | Steps + compensate |
| Provisioned concurrency | Warm N; pay |
20. Practice: मोठ्याने explain
- 60s: serverless cost quotas गोष्ट.
- 60s: sync vs async checkout.
- 60s: Lambda नको कधी.
- 60s: DLQ + idempotency.
- Record ×2.
21. Safe lab hygiene
- Tag owner+expiry.
- Budget alarm आधी.
- Read-only first.
- Cleanup.
- No secrets in env/screenshots.
- No provisioned on hello.
22. या chapter च्या links
- Compute: Lambda.
- HTTP: API Gateway.
- Data: DynamoDB.
- Messaging: SQS/SNS.
- Events: EventBridge.
- Workflows: Step Functions.
- build-* projects link.
23. Myths
| Myth | खरं |
|---|---|
| Servers नाहीत | Servers आहेत; manage नको |
| नेहमी स्वस्त | Steady वर EC2 |
| No Ops | IAM/data/alarms |
| एक Lambda | Bounded contexts |
| Queues optional | Load leveler |
24. Serverless error budget
Checkout error budget 0.1% असेल तर aggressive retries email duplicates देऊन budget जाळू शकतात. Money SLO ≠ notify SLO.
- दोन SLOs.
- Money retries bounded.
- Notify best-effort.
- Money page; notify ticket.
25. Regional notes (ap-south-1)
- Labs Mumbai.
- Feature availability.
- Data residency.
- Latency India.
26. Naming conventions
# Suggested prefixes
# Lambda: pay-intake-prod, pay-worker-prod
# SQS: pay-orders.fifo / pay-orders-dlq
# SNS: pay-order-events
# EB bus: pay.domain
# SFN: pay-refund-saga
# DDB: pay-orders-prod
env + domain नावात ठेवा. CloudWatch grep सोपा.
27. Pre-mortems
- Double charge headline.
- DLQ drain plan.
- Cognito outage mode.
- Runbook.
28. Currency / locale
Currencies आणि names rotate करा — global mental model.
29. Festival 10x
- Model 10x.
- Quota low.
- Reserve pay.
- Alarm 80.
30. Anti-patterns
- No cost owner.
- DEBUG prod.
- Quota day-of.
उजळणी, मुलाखत आणि तुलना cards
हा lesson काही मिनिटांत revise करा. Cards phone वर save करा किंवा PNG download करा. प्रत्येक card वरचा QR हा lesson उघडतो.








अजून cards: Ravi Sir's Cards.
सराव Tasks
Vidarbha Cotton Mills हा नागपूर मधला वस्त्रोद्योग व्यवसाय आहे. Ganesh Wankhede त्यांचं IT व cloud काम पाहतात. त्यांचे पैसे INR मध्ये मोजले जातात आणि AWS resources ap-south-1 Region मध्ये चालतात. खालच्या tasks मध्ये तुम्ही या lesson मध्ये शिकलेलं वापरून त्यांची खरी कामं करता. सगळी नावं, account IDs, IP addresses व numbers सरावासाठी काल्पनिक आहेत.
0 / 16
सोपं Inv
का: Idea.
काय करायचं: Invokes तर 1.
- Task मधले numbers लिहून घ्या.
- कागदावर step by step काढा.
- Box मध्ये फक्त final उत्तर लिहा.
- Check answer दाबा.
सोपं GBs
का: Idea.
काय करायचं: GB-s तर 1.
- Task मधले numbers लिहून घ्या.
- कागदावर step by step काढा.
- Box मध्ये फक्त final उत्तर लिहा.
- Check answer दाबा.
सोपं Logs
का: Idea.
काय करायचं: Logs तर 1.
- Task मधले numbers लिहून घ्या.
- कागदावर step by step काढा.
- Box मध्ये फक्त final उत्तर लिहा.
- Check answer दाबा.
सोपं Quota
का: Idea.
काय करायचं: Quotas तर 1.
- Task मधले numbers लिहून घ्या.
- कागदावर step by step काढा.
- Box मध्ये फक्त final उत्तर लिहा.
- Check answer दाबा.
सोपं 10x
का: Idea.
काय करायचं: 10x तर 1.
- Task मधले numbers लिहून घ्या.
- कागदावर step by step काढा.
- Box मध्ये फक्त final उत्तर लिहा.
- Check answer दाबा.
सोपं Retry
का: Idea.
काय करायचं: Retries तर 1.
- Task मधले numbers लिहून घ्या.
- कागदावर step by step काढा.
- Box मध्ये फक्त final उत्तर लिहा.
- Check answer दाबा.
सोपं FT
का: Idea.
काय करायचं: Free≠forever तर 1.
- Task मधले numbers लिहून घ्या.
- कागदावर step by step काढा.
- Box मध्ये फक्त final उत्तर लिहा.
- Check answer दाबा.
मध्यम RC
का: Idea.
काय करायचं: Reserved तर 1.
- Task मधले numbers लिहून घ्या.
- कागदावर step by step काढा.
- Box मध्ये फक्त final उत्तर लिहा.
- Check answer दाबा.
मध्यम Budget
का: Idea.
काय करायचं: Budget तर 1.
- Task मधले numbers लिहून घ्या.
- कागदावर step by step काढा.
- Box मध्ये फक्त final उत्तर लिहा.
- Check answer दाबा.
मध्यम Loop
का: Idea.
काय करायचं: Loop तर 1.
- Task मधले numbers लिहून घ्या.
- कागदावर step by step काढा.
- Box मध्ये फक्त final उत्तर लिहा.
- Check answer दाबा.
मध्यम PC
का: Idea.
काय करायचं: Provisioned तर 1.
- Task मधले numbers लिहून घ्या.
- कागदावर step by step काढा.
- Box मध्ये फक्त final उत्तर लिहा.
- Check answer दाबा.
मध्यम Thr
का: Idea.
काय करायचं: Throttle तर 1.
- Task मधले numbers लिहून घ्या.
- कागदावर step by step काढा.
- Box मध्ये फक्त final उत्तर लिहा.
- Check answer दाबा.
मध्यम Model
का: Sheet.
काय करायचं: invokes + gbs.
- Task मधल्या top-level keys पासून सुरू करा.
- Child keys 2 spaces ने indent करा (tabs नकोत).
- प्रत्येक property मध्ये task मधली value भरा.
- Check answer दाबा. Keys चा क्रम महत्त्वाचा नाही.
मध्यम Account
का: Concurrency.
काय करायचं: account.
- Task वाचा आणि ते कोणत्या AWS service बद्दल आहे ते ठरवा.
- aws लिहा, मग service चं नाव, मग operation (action शब्द).
- प्रत्येक आवश्यक flag (--name) व त्यापुढे task मधली value लिहा.
- Flags कोणत्याही क्रमाने चालतात. Check answer दाबा.
अवघड INR
का: Idea.
काय करायचं: USD+INR तर 1.
- Task मधले numbers लिहून घ्या.
- कागदावर step by step काढा.
- Box मध्ये फक्त final उत्तर लिहा.
- Check answer दाबा.
अवघड Ret
का: Idea.
काय करायचं: Null=forever तर 1.
- Task मधले numbers लिहून घ्या.
- कागदावर step by step काढा.
- Box मध्ये फक्त final उत्तर लिहा.
- Check answer दाबा.