Hands-On Serverless Applications with Go
eBook - ePub

Hands-On Serverless Applications with Go

Build real-world, production-ready applications with AWS Lambda

Mohamed Labouardy

Compartir libro
  1. 416 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Hands-On Serverless Applications with Go

Build real-world, production-ready applications with AWS Lambda

Mohamed Labouardy

Detalles del libro
Vista previa del libro
Índice
Citas

Información del libro

Learn to build, secure, deploy, and manage your serverless application in Golang with AWS Lambda

Key Features

  • Implement AWS lambda to build scalable and cost-efficient applications in Go
  • Design and set the data flow between cloud services and custom business logic
  • Learn to design Lambda functions using real-world examples and implementation scenarios

Book Description

Serverless architecture is popular in the tech community due to AWS Lambda. Go is simple to learn, straightforward to work with, and easy to read for other developers; and now it's been heralded as a supported language for AWS Lambda. This book is your optimal guide to designing a Go serverless application and deploying it to Lambda.

This book starts with a quick introduction to the world of serverless architecture and its benefits, and then delves into AWS Lambda using practical examples. You'll then learn how to design and build a production-ready application in Go using AWS serverless services with zero upfront infrastructure investment. The book will help you learn how to scale up serverless applications and handle distributed serverless systems in production. You will also learn how to log and test your application.

Along the way, you'll also discover how to set up a CI/CD pipeline to automate the deployment process of your Lambda functions. Moreover, you'll learn how to troubleshoot and monitor your apps in near real-time with services such as AWS CloudWatch and X-ray. This book will also teach you how to secure the access with AWS Cognito.

By the end of this book, you will have mastered designing, building, and deploying a Go serverless application.

What you will learn

  • Understand how AWS Lambda works and use it to create an application
  • Understand how to scaleup serverless applications
  • Design a cost-effective serverless application in AWS
  • Build a highly scalable and fault-tolerant CI/CD pipeline
  • Understand how to troubleshoot and monitor serverless apps in AWS
  • Discover the working of APIs and single page applications
  • Build a production-ready serverless application in Go

Who this book is for

This book is for Go developers who would like to learn about serverless architecture. Go programming knowledge is assumed. DevOps and Solution Architects who are interested in building serverless applications in Go can also choose this book.

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Hands-On Serverless Applications with Go un PDF/ePUB en línea?
Sí, puedes acceder a Hands-On Serverless Applications with Go de Mohamed Labouardy en formato PDF o ePUB, así como a otros libros populares de Computer Science y Cloud Computing. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
2018
ISBN
9781789133837
Edición
1
Categoría
Cloud Computing

Assessments

Chapter 1: Go Serverless

  1. What are the advantages of using the serverless approach?
Answer:
    • NoOps: no management or configuration overhead and faster time to market.
    • Autoscaling and HA: enhanced scalability and elasticity based on load.
    • Cost-optimization: pay only for the compute time your consume.
    • Polygot: leverage the power of nanoservices architecture.
  1. What makes Lambda a time-saving approach?
Answer: You pay per execution and you don't pay for idle resources, while with EC2 instances, you pay also for unused resources.
  1. How does serverless architecture enable microservices?
Answer: Microservices is the approach of breaking down a monolithic application into a collection of smaller and modular services. Serverless computing is a key enabled for microservices-based applications. It makes infrastructure even-driven and completely controlled by the needs of each service that makes up an application. Moreover, serverless means functions, and a microservice is a set of functions.
  1. What is the maximum time limit for an AWS Lambda function?
Answer: By default, each Lambda function has a 3 seconds timeout; the maximum duration you can set, is 5 minutes.
  1. Which of the following are supported event-sources for AWS Lambda?
    • Amazon Kinesis Data Streams
    • Amazon RDS
    • AWS CodeCommit
    • AWS CloudFormation
Answer: Amazon Kinesis Data Streams, AWS CodeCommit and CloudFormation are supported event-sources for AWS Lambda. The list of all supported event sources can be found on the following url: https://docs.aws.amazon.com/lambda/latest/dg/invoking-lambda-function.html
  1. Explain what a goroutine is in Go. How can you stop goroutines?
Answer: A goroutine is lightweight thread; it uses a resource called channel to communicate. Channels, by design, prevent race conditions from happening when accessing shared memory using goroutines. To stop a goroutine, we pass signal channel. That signal channel is used to push a value. The goroutine polls that channel regularly. As soon as it detects a signal, it quits.
  1. What's Lambda@Edge in AWS?
Answer: Lambda@Edge allows you to run Lambda functions at the edge locations of CloudFront in order to customize the content returned to your end users at the lowest latency.
  1. What's the difference between Function as a Service and Platform as a Service?
Answer: Both PaaS and FaaS allow you to easily deploy an application and scale it without worrying about the underlying infrastructure. However, FaaS saves you money because you pay only for the compute time used to handle the incoming requests.
  1. What's an AWS Lambda cold start?
Answer: Cold start happens when a new event is triggered; AWS Lambda creates and initialize a new instance or container to handle the request, which takes longer (Startup latency) compared to warm starts, where the container is reused from a previous event.
  1. Can AWS Lambda functions be stateless or stateful?
Answer: Lambda functions must be stateless to leverage the power of autoscaling due to increasing rate of incoming events.

Chapter 2: Getting Started with AWS Lambda

  1. Which format is not supported by the AWS CLI?
    • JSON
    • Table
    • XML
    • Text
Answer: The support values are JSON, table, and text. The default output is JSON.
  1. Is it recommended to use the AWS root account for everyday interaction with AWS? If yes, why?
Answer: AWS root account has the ultimate authority to create and delete AWS resources, change the billing, and even close the AWS account. Hence, it is strongly recommended to create an IAM user for everyday tasks with only the needed permissions.
  1. What environment variables do you need to set to use the AWS CLI?
Answer: The following are the required environment variables to configure the AWS CLI:
    • AWS_ACCESS_KEY_ID
    • AWS_SECRET_ACCESS_KEY
    • AWS_DEFAULT_REGION
  1. How do you use the AWS CLI with named profiles?
Answer: AWS_PROFILE can be used to set the CLI profile to use. The profile is stored in the credentials file. By default, AWS CLI uses the default profile.
  1. Explain the GOPATH environment variable.
Answer: The GOPATH environment variable specifies the location of your Go workspace. Default value is $HOME/go.
  1. Which command-line command compiles a program in Go?
    • go build
    • go run
    • go fmt
    • go doc
Answer: The as-mentioned commands do the following:
    • build: It is a compile package and dependencies and generate a single binary.
    • run: It i...

Índice