Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Cloud Native Programming with Golang

You're reading from   Cloud Native Programming with Golang Develop microservice-based high performance web apps for the cloud with Go

Arrow left icon
Product type Paperback
Published in Dec 2017
Publisher Packt
ISBN-13 9781787125988
Length 404 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Martin Helmich Martin Helmich
Author Profile Icon Martin Helmich
Martin Helmich
Mina Andrawos Mina Andrawos
Author Profile Icon Mina Andrawos
Mina Andrawos
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Modern Microservice Architectures FREE CHAPTER 2. Building Microservices Using Rest APIs 3. Securing Microservices 4. Asynchronous Microservice Architectures Using Message Queues 5. Building a Frontend with React 6. Deploying Your Application in Containers 7. AWS I – Fundamentals, AWS SDK for Go, and EC2 8. AWS II–S3, SQS, API Gateway, and DynamoDB 9. Continuous Delivery 10. Monitoring Your Application 11. Migration 12. Where to Go from Here?

AWS fundamentals

The simplest definition of AWS is that it's a service provided by Amazon, where you can buy virtual machines, databases, message queues, RESTful API endpoints, and all kinds of software products hosted on their cloud platform. To fully appreciate AWS, we will need to cover some of the major services that are offered on the platform. We will then dig deeper to learn how to reap the power of Go to build applications capable of utilizing the services AWS provides via its cloud APIs.

  • Elastic Compute Cloud (EC2): The Elastic Compute Cloud (EC2) is one of the most popular services provided by AWS. It can simply be described as a service to be used when needing to spin new server instances on AWS. EC2 is special in that it makes the process of starting servers and allocating resources practically easy for users and developers. EC2 allows auto-scaling, which means that applications can automatically scale up and down based on the user's needs. The service supports multiple setups and operating systems.
  • Simple Storage Service (S3): S3 allows developers to store different types of data for later retrieval and data analysis. S3 is another popular AWS service that is used by numerous developers all over the world. Typically, developers store images, photos, videos, and similar types of data on S3. The service is reliable, scales well, and easy to use. The use cases for S3 are plentiful; it can be used for web sites, mobile applications, IOT sensors, and more. 
  • Simple Queue Service (SQS): SQS is a hosted message queue service provided by AWS. In a nutshell, we can describe a message queue as a piece of software that can reliably receive messages, queue them, and deliver them between other applications. SQS is a scalable, reliable, and distributed hosted message queue. 
  • Amazon API Gateway: Amazon API gateway is a hosted service that enables developers to create secure web APIs at scale. It not only allows you to create and publish APIs, but also exposes sophisticated features such as access control, authorization, API versioning, and status monitoring. 
  • DynamoDB: DynamoDB is a NoSQL database that is hosted in AWS and provided as a service. The database is flexible, reliable, and scalable with a latency of only few milliseconds. NoSQL is a term used to describe databases that are nonrelational and enjoy high performance. A nonrelational database is a type of database that doesn't use tables with relations to store data. DynamoDB makes use of two data models: a document store and a key-value store. A document store database stores data in a collection of document files, whereas a key-value store puts data in simple key value pairs. In the next chapter, you will learn how to build Go applications in AWS that are capable of utilizing the power of DynamoDB.
  • AWS SDK for Go: The AWS SDK for Go is a collection of Go libraries that empower developers to write applications that can interact with the AWS ecosystem. Those libraries are the tools we'll utilize to make use of the different AWS services that we have mentioned so far, such as EC2, S3, DynamoDB, and SQS.

Throughout this chapter and the next one, we will be covering those technologies in deeper detail. Every single topic we will discuss in this chapter is massive and can be covered in entire books. So, instead of covering every single aspect of each AWS service, we will provide practical insights into each service and how to utilize them as a whole to build powerful production grade applications. Before diving deep into each AWS service, let's cover some general concepts in the AWS world.

The AWS console

The AWS console is the web portal that provides us access to the multitude of services and features that AWS offers. To access the portal, you first need to navigate to aws.amazon.com, and then choose the Sign In to the Console option, as follows:

Once you sign in to the console, you will be greeted with a web page that showcases the services provided by AWS:

AWS command-line interface (CLI)

AWS CLI is an open source tool that provides commands to interact with AWS services. AWS CLI is cross-platform; it can run on Linux, macOS, and Windows. In this chapter, we will use the tool for certain tasks, such as copying files from an S3 folder to an EC2 instance. AWS CLI can perform tasks that are similar to those performed by the AWS console; this includes configuration, deployment, and monitoring of AWS services. The tool can be found at https://aws.amazon.com/cli/.

AWS regions and zones

AWS services are hosted on multiple geographical locations around the world. In the world of AWS, locations consist of regions and availability zones. Each region is an independent geographical location. Each region contains multiple isolated internal locations known as availability zones. Some services — such as Amazon EC2, for examplegive you full power as to which regions to use for your service deployment. You can also replicate resources across regions. You can find a list of available AWS regions at http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-available-regions.

For complex application deployments in AWS, developers typically deploy their microservices into multiple regions. This ensures that the application will enjoy high availability, even if any Amazon data center in a certain region suffers from a failure.

AWS tags

AWS tags is another important concept in the AWS universe. It allows you to categorize your different AWS resources properly. This is very useful, especially when you use numerous AWS services for different things. For example, you can set one or more tags to identify the S3 storage bucket that you use for your mobile application. The same tags can then be used to identify the EC2 instance you use for that mobile application backend. A tag is a key value pair; the value is optional. 

A good resource for better understanding AWS tags can be found at: https://aws.amazon.com/answers/account-management/aws-tagging-strategies/.

AWS Elastic Beanstalk

Before we start to practically dive into AWS services, it is important to mention a useful service in the AWS ecosystem called Elastic Beanstalk. The purpose of this service is to provide an easy-to-use configuration wizard via the AWS console, which allows you to quickly deploy and scale your applications on AWS. 

This service is useful in multiple scenarios, and we encourage the reader to explore it after reading this chapter and the next chapter of the book. However, we will not be focusing on Elastic Beanstalk in this book. That is because the purpose of this book when it comes to AWS is to provide you a practical foundational knowledge on the inner workings of the main AWS services. This knowledge will make it easy for you to not only deploy and run applications on AWS, but also to have a good grasp of how things work, and make tweaks when necessary. The foundational knowledge is also what you would need to then move your skills to the next level beyond this book.

Covering AWS Beanstalk without diving into the key AWS services that make AWS a great choice for developers will not be enough for you to obtain enough knowledge to be effective in the long run. However, if you take a look at AWS Beanstalk after going through this chapter and the next chapter of the book, you will be able to understand what happens behind the scenes.

The service can be found at https://aws.amazon.com/elasticbeanstalk/.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image