๐Ÿ’ก Scaling up to your first 1 Million Users ๐Ÿšฆ

๐Ÿ’ก Scaling up to your first 1 Million Users ๐Ÿšฆ


3 min read

๐ŸŽฏ Iterative Application Modernization Pattern & Strangler Pattern ๐Ÿ“š

๐ŸŽฏ Deploy Your first Web Application in minutes on Heroku || AWS AppRunner & RDS (Free-Tier ๐Ÿ†“)

1. Iterative Application Modernization

Monolith to MicroServices: Many Monolithic Applications generate revenue for your company by adding value to your customers. You may have heard statements such as "let's move to a MicroService-based Architecture", but "we must deal with the Data Tier first".

How do we get there safely when we are heavily dependent on the application โ‰๏ธ

โœ… Martin Fowlerโ€™s Strangler Pattern ๐Ÿ“š: This methodology has been applied to moving specific data sets from a multi-terabyte Monolithic Database to a Purpose-built Database (SQL: MySQL / Postgres; NoSQL: MongoDB / DynamoDB), and utilizing a Data Lake to improve data access and performance.

[Example] eCommerce Breaking-down the Monolith (Data-tier and App-tier)

Iterative Application Modernization Pattern.gif

  • We have separated Shipping Service Data into a purpose-built database and a MicroService designed to handle shipping. With the newly developed Shipping Service, you will have the opportunity to develop MicroServices that focus on one job and do it extremely well.
  • The Orders Service will come next, and Inventory Service will get their own MicroServices.
  • Shopping Cart Service remain in the Monolith to ensure that customer service is not disrupted while the application is rearchitected. Once all monolithic capabilities have been replaced by MicroServices, we can now eliminate the monolith-app. Note that both Monoliths and MicroServices will coexist for a period of time.

โ˜‘๏ธ Additionally, you may also use Adapter pattern and Faรงade pattern.

2. ๐Ÿ†“ [Dev/Test] Users < 10,000

  • ๐Ÿฅ‡ Multi-AZ
  • ๐Ÿฅ‡ Elastic Load Balancing between tiers
  • ๐Ÿฅ‡ Auto Scaling
  • ๐ŸŽ–๏ธ Service-Oriented Architecture (SOA): Split Tiers into individual SOA Services.

Lab 1. Hosting Apps on Heroku

โ˜‘๏ธ TODO: heroku.com/deploy?template=https://github.c..


โš ๏ธ Heroku Free-Tier: Heroku Pricing || Where Can Heroku Free Tier Users Go?

  • [Example] This application has the following components:


    • Backend: Node.js REST API built with Express.js with resource endpoints that use Client to handle database operations against a PostgreSQL database (e.g., hosted on Heroku).
    • Frontend: Static HTML page to interact with the API.

Lab 2. Deploy Your first Web Application in minutes

3. ๐Ÿฅˆ [Staging]

  • ๐Ÿฅˆ Serving content smartly (Cloud Storage/S3, CDN/Cloudfront)
  • ๐Ÿฅˆ Caching off databases
  • ๐Ÿฅˆ Moving state-off tiers that auto scale

4. ๐Ÿฅ‰ Production

  • ๐Ÿฅ‰ Monitoring, metrics, and logging: Deeply analyze your entire stack then fine-tuning of your application.

    AWS X-Ray - Visualize service call graph.gif

  • ๐Ÿฅ‰ Going from Multi-AZ to Multi-Region

  • ๐Ÿฅ‰ Database:

    • Federation: Splitting into multiple databases based on function
    • Sharding: Splitting one data set across multiple hosts
    • Moving some functionality to other types of databases (NoSQL, Graph)


5. Next Steps โšก

  • ๐Ÿ… Service-Oriented Architecture (SOA) of features/functionality

  • ๐Ÿ…Build serverless whenever possible โšก

    The Micro-Services architecture.gif