Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Moving from single tenant to multi tenant

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.
Avatar for Pubudu Pubudu
October 10, 2024

Moving from single tenant to multi tenant

AWS Community Day NL - 2024

Avatar for Pubudu

Pubudu

October 10, 2024
Tweet

More Decks by Pubudu

Other Decks in Technology

Transcript

  1. Rearchitecting for scalability: Pubudu Jayawardana Moving a mission critical application

    from single-tenant to multi-tenant Ryno Marree ACD302 AWS Community Day NL 2024
  2. Agenda • What is single-tenancy and multi-tenancy • Use case:

    at PostNL - Why migrate to multi-tenancy - Migration steps • Results 2
  3. 3 Pubudu Senior Solutions Software Engineer @ PostNL Ryno Senior

    Solutions Software Engineer @ PostNL About Us
  4. 11 Multi-tenancy Pros Cons • Cost efficient • Scalability •

    Easy to manage • Faster updates • Resource optimization • Security concerns • Compliance is complex • Limited customizations • Noisy neighbour issues
  5. Mail items per day Parcels per day 1.1 million 6.9

    million PostNL in figures - volume 13 End 2023
  6. EBE – Event Broker E-Commerce 15 ✓ Self-service ✓ Helps

    decoupling of other applications ✓ Integration as service
  7. 19 Limitations • Higher deployment time • ~ 8 minutes

    per stack • ~ 2 hours to update all (even with parallelization) • AWS resource limits • Cloudformation APIs • Code Deploy • API GW • Custom solution to prevent throttling • Cost • Lots of identical resources
  8. Producers: SQS Still use producer specific resources • Access controls

    – cannot see which AWS account a message came from • We still want alarms per producer 23
  9. Migration: strategy • Events need to be more self-descriptive •

    Dynamic vs static config o Environment vars vs DynamoDB Bundle Dynamic 29
  10. Migration: Strategy • Big bang vs small increments • Many

    small blue-green or canary deployments • Switching ESM's was safe and easy 30
  11. 32 Results • Faster deployments • Creation of producer/consumer ~1

    minute (from 8 minutes) • No re-deploy all • Cost reduction • Code Deploy • Alarms • KMS • Lambda
  12. 33 But... what about the cons? In EBE: • No

    strict compliance requirements • Very little customizations pre producer/consumer • Solutions for noisy neighbours -> ESM concurrency
  13. 34 Summary Single-tenancy Multi-tenancy • Limited number of customers •

    Will not grow fast • Compliance • Customizations • You need to scale