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

Simply Serverless

Annyce D.
January 16, 2020

Simply Serverless

Is your team using lambdas? Do you hear your backend developers talking about serverless applications? Curious to learn more? If so, this talk is for you. Effective serverless architectures require less backend code, less complexity, less risk, and less tech debt. But how is that possible? This talk aims to answer that question for you.

We'll cover:
* What is serverless
* When might you use it, and
* How can you develop a serverless app with Kotlin

Serverless application design is becoming more and more prevalent. Now is the time to understand this powerful shift in backend development, simply.

Annyce D.

January 16, 2020
Tweet

More Decks by Annyce D.

Other Decks in Programming

Transcript

  1. Lambda @brwngrldev • Launched by AWS in 2014 • Function

    as a Service (FaaS) • Typically event-driven (15 mins)
  2. Lambda @brwngrldev • Launched by AWS in 2014 • Function

    as a Service (FaaS) • Typically event-driven (15 mins) • Multi-language support
  3. Services @brwngrldev Area Type Compute Functions (Lambda) Storage Files, data

    (S3, DynamoDB) Streaming Messages, queues (SNS, SQS)
  4. Services @brwngrldev Area Type Compute Functions (Lambda) Storage Files, data

    (S3, DynamoDB) Streaming Messages, queues (SNS, SQS) Querying ETL, SQL, ML (Rekognition)
  5. Pros @brwngrldev • Faster time-to-market • Cost savings • Simplified

    scalability • No specialized DevOps Cons • Ecosystem immature
  6. Pros @brwngrldev • Faster time-to-market • Cost savings • Simplified

    scalability • No specialized DevOps Cons • Ecosystem immature • Vendor lock-in
  7. Pros @brwngrldev • Faster time-to-market • Cost savings • Simplified

    scalability • No specialized DevOps Cons • Ecosystem immature • Vendor lock-in • Multiple moving pieces
  8. Pros @brwngrldev • Faster time-to-market • Cost savings • Simplified

    scalability • No specialized DevOps Cons • Ecosystem immature • Vendor lock-in • Multiple moving pieces • Learning curve
  9. resource "aws_api_gateway_method" "index_html" { depends_on = ["aws_api_gateway_resource.index_html"] rest_api_id = "${aws_api_gateway_rest_api.ufo_sightings.id}"

    resource_id = "${aws_api_gateway_resource.index_html.id}" http_method = "GET" authorization = "NONE" } resource "aws_api_gateway_resource" "graphql" { depends_on = ["aws_api_gateway_rest_api.ufo_sightings"] rest_api_id = "${aws_api_gateway_rest_api.ufo_sightings.id}" parent_id = "${aws_api_gateway_rest_api.ufo_sightings.root_resource_id}" path_part = "graphql" } resource "aws_cloudwatch_event_rule" "autowarm_merged_0" { name = "autowarm-merged-0" schedule_expression = "cron(0/5 * * * ? *)" } @brwngrldev Deploy Terraform
  10. @brwngrldev get("/") { call.respondRedirect("index.html") } post("/graphql") { val request =

    call.receive<GraphQLRequest>() … call.respondText(result) } Ktor
  11. @brwngrldev Koin val mainModule = module { single { Gson()

    } single { AppSchema(get()) } single { UFOSightingDatabase() } }
  12. @brwngrldev Koin val mainModule = module { single { Gson()

    } single { AppSchema(get()) } single { UFOSightingDatabase() } } val appSchema: AppSchema by inject() val gson: Gson by inject()
  13. @brwngrldev Ktor & Kotless class UFOSightingsApp : Kotless() { override

    fun prepare(app: Application) { with(app) { main() routes() } } }
  14. @brwngrldev kotless { config { bucket = "ktor-kotless-ufo.s3.adavis.info" dsl {

    type = DSLType.Ktor } terraform { profile = "default" region = "us-east-1" } } webapp { } }
  15. @brwngrldev kotless { config { bucket = "ktor-kotless-ufo.s3.adavis.info" dsl {

    type = DSLType.Ktor } terraform { profile = "default" region = "us-east-1" } } webapp { route53 = Route53("api", "ktor-kotless-ufo.info") } }
  16. References @brwngrldev • Serverless Architectures (https://martinfowler.com/articles/serverless.html) • Kotless - Kotlin

    Serverless Framework (https://www.youtube.com/watch?v=69uk3Pi88AE) • AWS Serverless Resources (https://aws.amazon.com/serverless/resources) • 5 principles for cloud-native architecture (https://cloud.google.com/blog/products/application- development/5-principles-for-cloud-native-architecture-what-it-is-and-how-to-master-it) • GCP Solution Architectures (https://docs.google.com/presentation/d/ 1vjm5YdmOH5LrubFhHf1vlqW2O9Z2UqdWA8biN3e8K5U/edit#slide=id.p85)