Reimagine an app on AWS

Vincenzo Scalzi

 

Engineer, Tech lead, DevOps, whatever fits

Reads Hacker News a lot. Too much.

Story time!

Proprietary, business-critical software

Windows server

On premise

License fees

Operational overhead

Maintenance & Support

The service responds slowly!

I need feature X!

Why isn't there a mobile version?

How much does it cost again?

Why does it take ten clicks to do Y?

This interface looks dated.

Off the shelf is great

…until it is not

Anyway…

AWS Lambda

AWS Fargate

Amazon API Gateway

Amazon ELB

Amazon DynamoDB

Amazon Elasticache

Amazon S3

The Migration

Rehost (Lift and Shift)

Replatform (PaaS)

Refactor ("Cloud-native")

Rebuild (From scratch)

Replace (SaaS)

Retire (Decommission)

Retain (Do nothing)

7 Rs

The A-Team

Technical sponsor

Experienced; Knows the business, the company; Has built similar solutions; Maker spirit

Me

Knows how to code, deploy, use the Cloud; Never created a product before; Maker spirit in a thinker head

Practice Leader

Very experienced; Also knows how to sell the tech; Encourages innovation!

Ops team

Knows about the project and the Cloud; Provides help to keep stuff running smoothly

Six months later

Me

Helping a second team, too

Final users

Know their business; Had complaints

PM

Backend dev

Frontend dev

Solutions architect

Data scientist

Developers

Final users

Know their business; Had complaints

PM

Accept bad takes

Build. Improve. Relentlessly.

Use services that free up your time

Simplify decision making

Back to the Story

These are sensors

They can only push data

Behind a gateway

Data only flows outwards

These networks...

Inside a larger network

With its own gateway

With their own gateways

What is on the other side?

?

The Project

?

?

aws

OpenAPI

API Gateway

Lambda

{
  "swagger": "2.0",
  "paths": {
    "/database/{database}/query/latest": {
      "post": {
        "x-amazon-apigateway-integration": "${lbd-latest-query}",
        "security": [
          {
            "api_key": []
          }
        ]
      }
    }
  },
  "securityDefinitions": {
    "api_key": {
      "name": "x-api-key",
      "in": "header",
      "type": "apiKey"
    }
  }
}
{
    "uri": "${invoke_arn}",
    "httpMethod": "POST",
    "type": "aws_proxy",
    "payloadFormatVersion": "1.0"
}
  1. Edit OpenAPI with tool
  2. Ask Infra as Code to fill the blanks
  3. Deploy, done!

data APIs (core)

write

read

viewer app

explorer

meta API

(core)

alerts API

domain specific apps

Elasticache

InfluxDB

ALB + ECS (EC2)

S3

CloudFront + S3

EventBridge + Lambda

DynamoDB

Step Functions + Lambda

data API (core)

explorer

viewer app

meta API

(core)

domain specific apps

alerts API

ALB + ECS (Fargate)

Patterns

Learning about the "ways" of the company

Deploying infra for the first time

Deploying infra for the Nth time

Maintaining every deployment and its specifics

Understanding the requirements

How?

Maintaining every deployment and its specifics

Researching the same topics time and time again

Copy-pasting untrustable code

Missing out on the "next big thing" developed by some other team

Capture common ideas

Create shared pieces of code

Create modules to avoid copy-pasting

Improve upon modules

Think high-order

Fall into the governance trap

The governance trap

Who

is responsible

How

What

When

maintains

prioritizes

contributes

Start

(and keep it)

simple

Provider (AWS)

Patterns

Amazon S3

Amazon API Gateway

AWS Lambda

Amazon CloudFront

Amazon ECS (AWS Fargate)

Frontend

API service (Lambda)

API service (Container)

Example

Project

Project

Project

Project

Project

Project

Pattern

Experiment

High-Order

Idea

🐛

🐛

🐛

🐛

Modules are for refactoring code however they hide complexity!

Not every use case can fit inside an existing module

The more you have, the more you have to maintain!

Aim 80~90%

Caution

Ask-a-DEV

Mistaeks

ke

1. Being clever with API design

[
    {
        "aggregation": "none"
    },
    {
        "aggregation": {
            "functions": [{
                "name": "sum",
                "alias": "someAlias"
            }],
            "interval": "1d23h0m12s"
        }
    }
]

2. Unrequested core features

Initiative + bad take

{
    "filters": [{
        "left": "(value - 32) * 5 / 9",
        "operator": "<",
        "right": "35.5"
    }, {
        "left": "(value - 32) * 5 / 9",
        "operator": ">",
        "right": "37.6"
    }]
}

3. Team dependencies

Whether you get an API specification to integrate with other teams or not, if you are blocked don't be.

 

Do it yourself

 

If you know that permissions are loose and you need to call some service, don't wait for ops.

 

Do it yourself (and then tell them)

3. Backlog not found

Not a problem if:

  • There is a shared strategy;
  • Everyone has a clear scope of action;
  • Everyone communicates and documents;
  • Everyone asks questions, makes decisions, challenges.

5. Code leniency

Be kind with other developers, but not too kind. Everyone has different ways to review code, especially when multiple languages are used.

 

Set expectations about: linting, tests, comments, tooling, observability, security, performance, acceptable tradeoffs, environment, packaging, language features, etc.

6. Supervision

If you have Infra as Code modules, package observability capabilities with them! And security features, backup, etc.

 

Note: In this case, this was actively forbidden, but still!

Any questions?