Skip to content

Latest commit

 

History

History
175 lines (159 loc) · 7.26 KB

cost-analysis.md

File metadata and controls

175 lines (159 loc) · 7.26 KB

Cost Analysis (ballpark only)

Context

High initial infrastructure expenditures are one of the obstacles in launching a new project. This poses a typical "chicken and egg" dilemma to justify the timing and need of investment into new products and features. It is important to pay attention on the costs and keep them minimal, especially until the platform gains traction.

This document attempts to estimate a rough high-level ballpark short-term deployment cost of the overall architecture. While the costs presented in this document might not be accurate, these numbers can help in producing the final implementation plan (prioritizing features, estimating the return on investment for each architectural subsystem, using third-party offerings instead of building one, preparing short-term vs long-term strategy etc).

Note that as more and more users sign-up and the platform gains traction, "the effective per unit cost" of the infrastructure is expected to reduce significantly. This is because Economies of Scale is highly prevalent on such backend systems.

High-level Estimates (ballpark only)

This section provides high-level rougth ballpark estimates of the architecture. Please take these numbers with a pinch of salt as coming up with highly accurate estimates require building POCs, load-testing micro-services and in-depth experimentation.

Assumptions

  • To ensure high-availability, a minimum of two containers are assumed to be running in all micro-services.
  • The implementation team should use these cost estimates for rough high level ballparks only. The instance sizes assumed in this cost exercise must be re-evaluated keeping the expected traffic and performance of the implemented business logic in mind.
  • Operational costs due to data I/O is not computed. In the initial phases, this cost is expected to be low due to low system usage.
  • Costs are computed for US region.

Cost Analysis

Subsystem Ballpark estimate Monthly Cost ($)
User Management subsystem EC2 (t3.large) * 2 = $0.08*30*24 * 2 = $120 per month

MySQL = $200 per month

AWS Identity and Access Management is offered free of charge.

$320
Platform Management subsystem Platform Management Service EC2 (t3.large) * 2 = $0.08*30*24 * 2 = $120 per month

MySQL = $80 per month

Db CDC Consumer (t3.large) * 2 = $120 per month

NP Offering manager (t3.large) * 2 = $120 per month

NP NoSQL Db (25 gb data in free tier) = $0 per month

$440
Search subsystem EC2 (t3.large) * 2 = $0.08*30*24 * 2 = $120 per month

Elasticsearch = $30 per month

Enrichment service EC2 (t3.large) * 2 = $0.08*30*24 * 2 = $120 per month

$270
Notification subsystem Notification service EC2 (t3.large) * 2 = $0.08*30*24 * 2 = $120 per month

Email Service / Push notification service EC2 (t3.large) * 2 = $0.083024 * 2 = $120 per month

Meeting scheduler (outsourced with free tier)

$240
Community Forum subsystem Community forum management service EC2 (t3.large) * 2 = $0.08*30*24 * 2 = $120 per month

Post Service EC2 (t3.large) * 2 = $0.083024 * 2 = $120 per month

NP NoSQL Db (assuming 100GB data) $0.25 per GB month * 75 GB with 25 GB in free tier = $30 per month

Feed / Ranking cache manager EC2 (t3.large) * 2 = $0.08*30*24 * 2 = $120 per month

$390
Analytics subsystem Stream/batch processing services EC2 (t3.large) * 4 = $0.08*30*24 * 4 = $240 per month

Assuming AWS Redshift basic tier as initial data is very low = $50

$290
Other common infrastructure components VPC = $90 per month

Load Balancer = 90 per month

Route 53 = $180 per month

Cache (cache.m5.large) * 2 = $80*2 per month

Message Bus (assuming 10 million messages) = $0.40 * 10 = $4

Object Store (assuming 10 million requests) = $0.005 * 10,000 = $50

Observability stack - Prometheus, Grafana, Metric Store (Cortex / AWS Cloudwatch) = $100

$550
Total costs with on-demand infrastructure provisioning $2590
Conservative savings with Reserved Instances -$777 (assuming 30%)
Total cost with reserved instances (ballpark) $1813

Note on cost savings

  • Costs can significantly be reduced (30-70%) by opting to reserve the instances on AWS. It is encouraged to make use of reserved instances wherever possible.
  • EC2 instance size of all micro-services is assumed to be t3.large. For initial bootstrapping, a smaller instance size can be used. Similarly, smaller instance sizes for Elasticache, RDS and other resources can be provisioned initially. AWS allows scaling up all these resources without downtime or with minimal downtime in some cases.
  • Implementation plan should be derived keeping these costs in mind. For example, it might be prudent to use a third-party offering for Notification & Meeting Scheduler Subsystem (Google Calendar) and Community Forum (Peerboard). At a later stage, these subsystems can be built in-house based on the usage, scale and required features. Start small, use ready-to-use third-party offerings for quick bootstrapping, iterate fast, and evolve.
  • AWS offerings include Free Tier plans for almost all its offerings. That should bring the day-zero costs down while building/bootstrapping the system. These free tiers are not fully considered in the above estimates.

References