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

An App Modernization Story with .NET Core, con...

Mete Atamel
March 03, 2021
100

An App Modernization Story with .NET Core, containers and Cloud Run

Back in 2016, I deployed an ASP.NET monolith app to IIS on Windows. It worked but it was clunky in every sense of the word. Over the years, the app was freed from Windows (thanks to .NET Core), containerized to run consistently in different environments (thanks to Docker) and decomposed into a set of loosely-coupled, event-driven, microservices (thanks to Knative and Cloud Run). Let's talk about the journey and learnings along the way.

Mete Atamel

March 03, 2021
Tweet

Transcript

  1. @meteatamel An App Modernization Story with .NET Core, containers and

    Cloud Run Mete Atamel Developer Advocate, Google Cloud @meteatamel speakerdeck.com/meteatamel atamel.dev/tags/app-modernization
  2. @meteatamel Reader Transformer Web API ASP.NET (4.6) Windows app on

    IIS hosting +Worked, easy to understand and deploy, inexpensive -Too much coupling, bad DevEx (FTP to see logs!), no redundancy, no persistence, no resilience Stage 0: Prototype (Early 2016)
  3. @meteatamel Deploy to Compute Engine on Google Cloud +Easy to

    move, redundancy, load-balancing, possibility of autoscaling, better DevEx with Stackdriver logging, VM snapshots etc. -More expensive Compute Engine Compute Engine Cloud Load Balancer Stage 1: Lift & Shift (2017)
  4. @meteatamel 1. .NET Core 2. Containers 3. Windows dependency 4.

    Costs The app served us well until 2019...
  5. @meteatamel Re-write in ASP.NET Core (2.2), containerize w/ Docker &

    deploy to App Engine Flex (Linux) +Windows license fees out, hassle-free autoscaling, revision management -Still VM based (expensive), slow deploys App Engine Stage 2: Containerization (Early 2019)
  6. @meteatamel Container to production in seconds Natively Serverless One experience,

    where you want it Cloud Run Bringing serverless to containers Around mid 2019...
  7. @meteatamel Public • Website • API endpoint Private • Internal

    services • Async tasks • Mobile backend • Webhook HTTPS Endpoint
  8. @meteatamel Billable time Instance Billable Time Request 1 Start Request

    1 End Request 2 Start Request 2 End Instance Time Billable Non-billable
  9. @meteatamel Update to ASP.NET Core (3.0) & deploy to Cloud

    Run +Serverless billing (no more VMs), much cheaper, awesome DevEx (fast deploys, integrated logging, etc.) -Monolith issues Cloud Run Stage 3: Serverless (Mid 2019)
  10. @meteatamel 1. Scaling: all or nothing 2. Cold starts 3.

    In-memory state 4. No way to update individual services Monolith issues
  11. @meteatamel Cloud Scheduler Cloud Pub/Sub Converter (Private) Cloud Storage Web

    (Public) Cloud Firestore Reader (Private) Stage 4: Monolith to microservices (Early 2020)
  12. @meteatamel Stage 5: Frontend in Flutter (Late 2020) Rewrote mobile

    frontend in Flutter Javascript → Dart & Ionic → Flutter were huge improvements Better tools in Flutter (eg. async data sync in UI) Great tools/plugins/community around Flutter
  13. @meteatamel • Transformation does not have to be all or

    nothing • Non-optimal → optimal solutions • Even simple lift & shift can have huge benefits • Expect some kind of rewrite at some point • Monolith decomposition is hard! Lessons Learned