gcloud-node: the Library for Node.js on Google Cloud Platform

Just a few hours ago Google announced very interesting news about improved support for Node.js on its Cloud platform. In fact, a client library for Node.js has been released by BigG for better integration of Cloud Datastore and Cloud Storage into Node.js applications. According to Google announcement, this is just the first of a set of libraries and new APIs that will be released soon to help developers build applications that take full advantage of Google resources. Very good news indeed, that will help the adoption of the Google Cloud Platform by developers who are interested in deploying their application in the Cloud.

What is Node.js?

Node.js is a very interesting technology originally developed by Ryan Dahl a few years ago. Shortly said, Node.js is a cross-platform runtime environment for server-side and networking applications. Node.js applications are written in JavaScript and can be run within the Node.js runtime on different operating systems with no changes. Given its asynchronous architecture, it is commonly used for real-time applications, and its built-in asynchronous I/O library for file, socket and HTTP communication opened the door to a lot of applications that acts as a server without using a native web server like Apache or Nginx. In fact, Node.js become widely popular as a high-performance server-side platform and quickly become the de-facto standard for server-side JavaScript.

Node.js is not free from accusations of being a bad technology. For example, many developers complain about the single-threaded design of Node.js, that doesn’t take advantage of modern multi-core CPUs. Some others criticize it for not being ready for distributed applications, or for its immaturity, or for the availability of a potentially risky package manager, and even more. No technology is perfect, and Node.js isn’t too, of course. It’s a very interesting framework that found many different areas where it fits perfectly and does a really great job. It comes to no surprise to me that Google saw such a big value in it to write and deliver a dedicated library.

gcloud-node

The new library Google wrote and announced today is targeted at reducing the boilerplate code you need to write when you try to access GCP services. Installation is quite easy, thanks to the availability of the software through the Node.js Package Manager under the name of “gcloud“. Being released under an open source license though, you can expect to find it available in top tier Linux distributions’ archives very soon. In any case, the configuration is quite easy and mostly consists of setting up the authentication. Quite interestingly, this is almost automatic if you deployed gcloud on Google Compute Engine instance that is already prepared to use service accounts: Google just takes care of everything. Otherwise, you need to turn on the APIs you are interested in from your Google Developers Console, adding the necessary credentials (client ID or JSON key) as always.

gcloud currently supports just two services: Cloud Datastore and Cloud Storage. It’s a shame other good stuff in the Google Cloud Platform is not available to gcloud-node yet, but hopefully, this will be fixed very soon. Nevertheless, the effort you need to spend to integrate those services seems quite small indeed. For example, take a look at this snippet of code, an example of integration with Datastore taken from Google’s announcement itself:
var gcloud = require('gcloud');
var dataset = new gcloud.datastore.Dataset({
projectId: 'my-project',
keyFilename: '/path/to/keyfile.json'
});

dataset.get(dataset.key('Product', 123), function(err, entity) {
console.log(err, entity);
});

Quite simple and effective indeed. And the availability of gcloud’s code on GitHub will definitely help it grow faster, thanks to contributions and bugfixes by community members who are interested in it. For more information about gcloud-node, take a look at the extensive documentation Google wrote on gcloud’s website.

Avatar

Written by

Andrea Colangelo

Software Engineer with a solid focus on QA and an extensive experience in ICT. Above all, Andrea has a very strong interest in Free and Open Source Software, and he is a Debian and Ubuntu Developer since years. Non-tech interests include: Rugby, Jazz music and Cooking.

Related Posts

Joe Nemer
Joe Nemer
— September 6, 2019

Google Cloud Functions vs. AWS Lambda: The Fight for Serverless Cloud Domination

Serverless computing: What is it and why is it important? A quick background The general concept of serverless computing was introduced to the market by Amazon Web Services (AWS) around 2014 with the release of AWS Lambda. As we know, cloud computing has made it possible for users to ...

Read more
  • AWS
  • Azure
  • Google Cloud Platform
Joe Nemer
Joe Nemer
— September 3, 2019

Google Vision vs. Amazon Rekognition: A Vendor-Neutral Comparison

Google Cloud Vision and Amazon Rekognition offer a broad spectrum of solutions, some of which are comparable in terms of functional details, quality, performance, and costs. This post is a fact-based comparative analysis on Google Vision vs. Amazon Rekognition and will focus on the tech...

Read more
  • Amazon Rekognition
  • AWS
  • Google Cloud Platform
  • Google Vision
Alisha Reyes
Alisha Reyes
— August 30, 2019

New on Cloud Academy: CISSP, AWS, Azure, & DevOps Labs, Python for Beginners, and more…

As Hurricane Dorian intensifies, it looks like Floridians across the entire state might have to hunker down for another big one. If you've gone through a hurricane, you know that preparing for one is no joke. You'll need a survival kit with plenty of water, flashlights, batteries, and n...

Read more
  • AWS
  • Azure
  • Google Cloud Platform
  • New content
  • Product Feature
  • Python programming
Avatar
Andrew Larkin
— August 13, 2019

Content Roadmap: AZ-500, ITIL 4, MS-100, Google Cloud Associate Engineer, and More

Last month, Cloud Academy joined forces with QA, the UK’s largest B2B skills provider, and it put us in an excellent position to solve a massive skills gap problem. As a result of this collaboration, you will see our training library grow with additions from QA’s massive catalog of 500+...

Read more
  • AWS
  • Azure
  • content roadmap
  • Google Cloud Platform
Avatar
Andrew Larkin
— August 7, 2019

Disadvantages of Cloud Computing

If you want to deliver digital services of any kind, you’ll need to estimate all types of resources, not the least of which are CPU, memory, storage, and network connectivity. Which resources you choose for your delivery —  cloud-based or local — is up to you. But you’ll definitely want...

Read more
  • AWS
  • Azure
  • Cloud Computing
  • Google Cloud Platform
Joe Nemer
Joe Nemer
— August 6, 2019

Google Cloud vs AWS: A Comparison (or can they be compared?)

The "Google Cloud vs AWS" argument used to be a common discussion among our members, but is this still really a thing? You may already know that there are three major players in the public cloud platforms arena: Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP)...

Read more
  • AWS
  • Google Cloud Platform
  • Kubernetes
Luca Casartelli
Luca Casartelli
— April 19, 2019

4 Key Takeaways from Google Cloud Next ’19

Google Cloud Next ’19 was the flagship Google Cloud Platform developers conference, held in San Francisco’s Moscone Center. I was lucky enough to attend it with Cloud Academy, and got the chance to check out tons of breakout sessions and get great insight firsthand.   Next ’19 was my...

Read more
  • Google Cloud Platform
  • Kubernetes
  • Machine Learning
Avatar
Giacomo Marinangeli
— March 29, 2019

NEW: Custom Hands-On Labs for Azure and Google Cloud Platform

Harvard Business Review recently estimated that some 90% of corporate training never gets applied on the job. Given the $200B training industry, that is a staggering amount of waste. One reason for the disconnect? Lack of context. Cloud Academy’s platform was built to make it extraor...

Read more
  • Azure
  • Content Engine
  • Google Cloud Platform
  • Hands-on Labs
Avatar
Andrew Larkin
— January 15, 2019

2018 Was a Big Year for Content at Cloud Academy

As Head of Content at Cloud Academy I work closely with our customers and my domain leads to prioritize quarterly content plans that will achieve the best outcomes for our customers. We started 2018 with two content objectives: To show customer teams how to use Cloud Services to solv...

Read more
  • AWS
  • Azure
  • Cloud Computing
  • Google Cloud Platform
Avatar
Guy Hummel
— November 21, 2018

Google Cloud Certification: Preparation and Prerequisites

Google Cloud Platform (GCP) has evolved from being a niche player to a serious competitor to Amazon Web Services and Microsoft Azure. In 2018, research firm Gartner placed Google in the Leaders quadrant in its Magic Quadrant for Cloud Infrastructure as a Service for the first time. In t...

Read more
  • AWS
  • Azure
  • Google Cloud Platform
Avatar
Cloud Academy Team
— September 18, 2018

How to Optimize Cloud Costs with Spot Instances: New on Cloud Academy

One of the main promises of cloud computing is access to nearly endless capacity. However, it doesn’t come cheap. With the introduction of Spot Instances for Amazon Web Services’ Elastic Compute Cloud (AWS EC2) in 2009, spot instances have been a way for major cloud providers to sell sp...

Read more
  • AWS
  • Azure
  • Google Cloud Platform
  • SpotInst
Avatar
Guy Hummel and Jeremy Cook
— August 23, 2018

What are the Benefits of Machine Learning in the Cloud?

A Comparison of Machine Learning Services on AWS, Azure, and Google Cloud Artificial intelligence and machine learning are steadily making their way into enterprise applications in areas such as customer support, fraud detection, and business intelligence. There is every reason to beli...

Read more
  • AWS
  • Azure
  • Google Cloud Platform
  • Machine Learning