GPC101 Chapter 31 Comparing the Cloud Service and the Local App

Previous chapter | TOC | GCP | Next chapter

© Copyright 2018 Nickantony Quach. All rights reserved.

1 Review of Earlier Chapters

Serverless computing is a misnomer but it means that the user of the computing infrastructure does not need to worry about the management of servers. Serverless computing is the execution model for cloud computing, which is the enabling of ubiquitous access to rapidly-provisioned resources in order to achieve economies of scale. Tell me more

As computing power is delivered on demand using a serverless infrastructure such as the Google Cloud Platform, coders no longer need to worry about the hardware in their work. The fastest way for to experience cloud computing and understand how to create and use a cloud service is to first read the chapter, Chapter 26 JavaScript calling Google Cloud Functions, in the online book, GCP 101 by Ri4C. You will be introduced to these two source code modules:

To get started, sign in at Cloud.google.com then do the following steps, unless you want to read front to back all chapters in the book according to the order found in its Table of Contents.

  1. Read the chapter, Chapter 11 Using Google Cloud Code Editor, and get to know several key modules on the GCP.
  2. Read the chapter, Chapter 13 Using Google Cloud Datastore, and see a way to keep your data on GCP.
  3. Read the chapter, Chapter 23 datastore23setvalue Cloud Service.
  4. As instructed in Chapter 23, create the cloud service, datastore23setvalue, using Google Cloud Functions.
  5. Read the chapter, Chapter 25 HTML App on Local Machine.
  6. As instructed in Chapter 25, create the web page, gcp101c25demo18A1, and place it in the Temp folder on your local machine.
  7. If not already done, read the chapter, Chapter 26 JavaScript calling Google Cloud Functions, and learn how to test the interaction between the cloud service, datastore23setvalue, and one of its users: gcp101c25demo18A1.

2 About this chapter

This chapter begins the third sequence in the online book, GCP 101 by Ri4C. The purpose of the third chapter sequence is to explain all the programming languages used in both the cloud service, datastore23setvalue, and the local app, gcp101c25demo18A1. The former is written mostly in Node.js whereas the latter is written mostly in JavaScript. For those who did not know, Node.js is an open-source, cross-platform JavaScript run-time environment for executing JavaScript code server-side.

3 Client-Server Architecture

The following table shows the differences between the cloud service and the local app.

 Topic The cloud service The local app
Software type: Server software Client software
Source code location: datastore23setvalue gcp101c25demo18A1
Status: Complete & Tested Complete & Tested
Environment: Google Cloud Functions Your local machine
Container: List of Cloud Services C:\Temp
Document type: JavaScript HTML
Framework language: Node.js HTML
Main syntax: JavaScript JavaScript
Lines of code: Less than 100 LOC Around 300 LOC
Data syntax: JSON
Using asynchronous logic: No Yes
Dependencies: {“dependencies”: { “@google-cloud/datastore”: “1.3.3” } } Cloud Service URL
Database used: Google Cloud Datastore None
Test environment: GCP Firefox  Developer Version
How to create: Chapter 23 Chapter 25
How to test: Chapter 23 Chapter 26
How to run: (1) Go to Google Cloud Functions (GCF). (2) Open the cloud service, datastore23setvalue. (3) Click on the Testing tab. (4) Press the button, Test the function. (5) Copy the JSON example on last line in the output to the input box, Triggering event. (6) Again, press the button, Test the function. (7) Verify data change in Datastore. (1) Open the file C:\Temp\gcp101c25demo18A1.htm, where the local app is created according to Chapter 25. (2) Press the Submit button. (3) Wait for about five seconds. (4) Repeat the last two steps until the result is as expected. (5) Verify data change in Datastore.
How to ultimately verify: The data is changed in Google Cloud Datastore (GCD). Go in there to verify the result. In both cases, the value under mycolumn3 of the mytable1 entity, whose name is as specified by the input data, is changed as declared by the input data.

*** End of Chapter ***

Next chapter


© Copyright 2018 Nickantony Quach. All rights reserved. | Other books | Edit

Advertisements