Book Image

JavaScript Cloud Native Development Cookbook

By : John Gilbert
Book Image

JavaScript Cloud Native Development Cookbook

By: John Gilbert

Overview of this book

Cloud-native development is a modern approach to building and running applications that leverages the merits of the cloud computing model. With cloud-native development, teams can deliver faster and in a more lean and agile manner as compared to traditional approaches. This recipe-based guide provides quick solutions for your cloud-native applications. Beginning with a brief introduction, JavaScript Cloud-Native Development Cookbook guides you in building and deploying serverless, event-driven, cloud-native microservices on AWS with Node.js. You'll then move on to the fundamental patterns of developing autonomous cloud-native services and understand the tools and techniques involved in creating globally scalable, highly available, and resilient cloud-native applications. The book also covers multi-regional deployments and leveraging the edge of the cloud to maximize responsiveness, resilience, and elasticity. In the latter chapters you'll explore techniques for building fully automated, continuous deployment pipelines and gain insights into polyglot cloud-native development on popular cloud platforms such as Azure and Google Cloud Platform (GCP). By the end of the book, you'll be able to apply these skills to build powerful cloud-native solutions.
Table of Contents (13 chapters)

To get the most out of this book

To follow along with the recipes in this cookbook, you will need to configure your development environment according to these steps:

  1. Install Node Version Manager (https://github.com/creationix/nvm or https://github.com/coreybutler/nvm-windows)
  2. Install Node.js with nvm install 8
  3. Install the Serverless Framework with npm install serverless -g
  4. Create a MY_STAGE environment variable with export MY_STAGE=<your-name>
  5. Create an AWS account (https://aws.amazon.com/free) and configure your credentials for the Serverless Framework (https://serverless.com/framework/docs/providers/aws/guide/credentials)

    Download the example code files

    You can download the example code files for this book from your account at http://www.packt.com. If you purchased this book elsewhere, you can visit www.packt.com/support and register to have the files emailed directly to you.

    You can download the code files by following these steps:

    1. Log in or register at www.packt.com.
    2. Select the SUPPORT tab.
    3. Click on Code Downloads & Errata.
    4. Enter the name of the book in the Search box and follow the onscreen instructions.

    Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

    • WinRAR/7-Zip for Windows
    • Zipeg/iZip/UnRarX for Mac
    • 7-Zip/PeaZip for Linux

    The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/JavaScript-Cloud-Native-Development-Cookbook. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

    Download the color images

    Conventions used

    There are a number of text conventions used throughout this book.

    CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "The first thing to note is that we must define runtime: nodejs8.10 in the serverless.yml file."

    A block of code is set as follows:

    module.exports.hello = (event, context, callback) => {
    console.log('event: %j', event);
    console.log('env: %j', process.env);

    callback(null, 'success');
    };

    When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

    service: cncb-create-function
    ...
    functions:
    hello:
    handler: handler.hello

    Any command-line input or output is written as follows:

    $ npm run dp:lcl -- -s $MY_STAGE

    Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Select Monitors | New Monitor | Event"

    Warnings or important notes appear like this.
    Tips and tricks appear like this.