achieving serverless harmony
play

Achieving Serverless Harmony With Traditional Apps Story Time - PowerPoint PPT Presentation

Achieving Serverless Harmony With Traditional Apps Story Time Began with EC2 instances in ASGs, Ansible automation Introduced Serverless Framework Replace small HTTP service with API Gateway Move async jobs into Lambda Kill


  1. Achieving Serverless Harmony With Traditional Apps

  2. Story Time ● Began with EC2 instances in ASG’s, Ansible automation ● Introduced Serverless Framework ● Replace small HTTP service with API Gateway ● Move async jobs into Lambda ● Kill async/cron workers harmonize.serverless.zone

  3. Expensive Tasks 1. Breaking up shared-memory coupling 2. Connecting legacy apps to new event streams 3. Rewriting jobs to Lambda-supported languages harmonize.serverless.zone

  4. Incidental Glue Backend Tasks User-Facing FaaS in other Services Intentional Event Stream Major Replacement Using Cognito triggers, Architecture and plans Critical-path features Config Rules, and infra change to match new move from your monolith cron jobs. tools/processes and to separate serverless intentionally start deployments. migrating features. harmonize.serverless.zone

  5. Cheap Tasks 1. Solving embarrassingly parallel problems 2. Training the rest of the team 3. Shrinking server fleet harmonize.serverless.zone

  6. Starting Points On-Prem IaaS Cloud Native Bare Metal Virtual Machines Highly Automated VMs/ Containers harmonize.serverless.zone

  7. Hard Parts

  8. ● Introduce back pressure ● Prioritize user-facing tasks Scaling Denormalize data into ● messages Downstream Service Considerations harmonize.serverless.zone

  9. Queueueueueueueing ● Kinesis retries handle capacity problems ● Serial, but only if you fit on one shard ● Put the full information the event needs in its trigger ○ S3 notably can’t ○ SNS partially does this with invoke event size limit ● Dead Letter Queue harmonize.serverless.zone

  10. DynamoDB ● Makes a great scratch space because events include ○ HASH+RANGE New and old versions of modified data ○ TTL to expire finished job records while leaving an audit trail ○ ● RCU/WCU remaining provides back pressure ● Autoscaling (with limits) Even adjustable … from a Lambda ○ harmonize.serverless.zone

  11. ● Monorepo vs. split service Codebases Deployment pipelines ● harmonize.serverless.zone

  12. Monorepo ● Keeps attribution ● Smaller individual repos ● Single history ● Per-repo test pipelines Always test full repo Fewer changes in-flight ● ● Cross-cutting changes are easier Cross-repo changes ● ● ● No dependent pull requests ● Submodules (ew) harmonize.serverless.zone

  13. Deploy Pipelines ● Deploys have to be independent ● Avoid backwards incompatible changes in event formats ● DB migrations now have one more step harmonize.serverless.zone

  14. ● Log log log log Cloudwatch connections ● Monitoring ● Combine legacy and new sources ● Teach new techniques Revealing Brewing Problems harmonize.serverless.zone

  15. Structured Logging ● Logs are events, not strings ● Machine-readability matters ● CloudWatch filters can parse logged values to metrics ● JSON avoids regex pain and sadness harmonize.serverless.zone

  16. Structured Log { “timestamp”: 1493214552, “event”: “user.login.success”, “user”: “ryansb”, “method”: “totp-2fa”, “source”: { “type”: “web.navbar”, “client”: “git-b263b0” } }

  17. Central Visibility ● Forward everything to... ○ CloudWatch? ○ IOPipe (Lambda Only) ○ Honeycomb ○ ELK Stack harmonize.serverless.zone

  18. Thanks! harmonize.serverless.zone @ryan_sb

Recommend


More recommend