In this presentation we introduce basics of building and deploying Grails applications on Google Cloud as well as using Bigtable, Cloud Storage, and PubSub with Grails apps.
No part of these notes may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior, written permission of Object Computing, Inc. (OCI) Grails and Google Cloud Greach 2018 Ryan Vanderwerf
3 WE ARE SOFTWARE ENGINEERS. We deliver mission-critical software solutions that accelerate innovation within your organization and stand up to the evolving demands of your business. INDUSTRIAL IoT BLOCKCHAIN CONSULTING MACHINE LEARNING CLOUD SOLUTIONS AREAS OF EXPERTISE We equip industrial environments with seamless connectivity and real-time analytics that reduce operating costs and deliver on customer demands. We can modernize your legacy applications and enable scalable, integrated AI capabilities tailored to your unique sets of data. We are at the forefront of blockchain technology, and we have practical, real-world experience with its implementation. We combine software engineering expertise with cloud-native architecture to accelerate innovation within your organization.
reserved. Free Stuff • There is now a free tier! Google now competes with AWS 1 year free tier • Also get starter $300 USD credit • Compute - free f1.micro + 3GB HDD instance per month (us regions only) • AppEngine - free 28 instance hours/day • Cloud storage - 5GB • free memcache • 1000 search ops/day • 100 emails/day • 10GB sub/sub messages/mo • and more.. check out https://cloud.google.com/free/ for everything Google Compute Overview
reserved. • Why Google Cloud? • You may be asked by your employer to investigate • Your employer may have already adopted • Where does it stand? (Gartner chart) Google Compute Overview
reserved. Go to https://console.cloud.google.com/home/dashboard • create a project - resources are always tied to context of a project • Next let's install the Cloud SDK Google Cloud Console
reserved. This is how you interact with Google cloud remotely • Download the SDK for your operating system at https://cloud.google.com/sdk/downloads • Run 'gcloud init' to set up your SDK • Enter your account, and select the project you will be working with • Next let's use app engine! Google Cloud SDK
reserved. Run 'gcloud app create' to create the AppEngine • Pick the region/zone you want • It will say use 'gcloud app deploy' but we'll be using the Gradle AppEngine plugin instead • Next we'll set up our Grails App to be able to be deployed • Create Grails App using start.grails.org or SDK man and run 'grails create-app <name>' Google App Engine
reserved. • Setup App Engine plugin in build.gradle • Setup App Engine yaml config file app.yaml • We switch Tomcat out with Jetty as it works better with App Engine Google App Engine
reserved. Enable Cloud SQL API • Go to API Manager • Enable Google Cloud SQL API Create Cloud SQL Instance • Datasource using Cloud SQL • Create Instance • Add MySQL jars to build.gradle • Get instance connection name and add to application.yml • Example Grails Application Demo Google Compute Overview
reserved. What is Google Cloud Storage? Google Cloud storage is an network object store like Amazon S3 • Enable Google Cloud Storage API • Create Bucket • Add jars to build.gradle • Add config to application.yml • Demo Grails Application Google Cloud Storage
reserved. Bigtable is a Hbase cluster on Google Cloud • Wide Column Store • Mapreduce but with Transactions • Powers Google services, including Search, Analytics, Maps, and Gmail • Use Apache HBase Java libraries to access Google BigTable
reserved. What is BigTable? • Cloud Bigtable is a sparsely populated table that can scale to billions of rows and thousands of columns, allowing you to store terabytes or even petabytes of data. • What is it good for? • Cloud Bigtable is ideal for applications that need very high throughput and scalability for non-structured key/value data, where each value is typically no larger than 10 MB. • Cloud Bigtable also excels as a storage engine for batch MapReduce operations, stream processing/analytics, and machine-learning applications. Google BigTable
reserved. Storage Architecture • Stores data in massively scalable tables • The table is composed of rows • Each describes a single entity • Columns contain individual values • Each row is indexed by a single row key, and columns that are related to one another are typically grouped together into a column family • Each column is identified by a combination of the column family and a column qualifier, which is a unique name within the column family. Google BigTable
reserved. About the diagram • The table contains one column family, the follows family. This family contains multiple column qualifiers • Column qualifiers are used as data. This design choice takes advantage of the sparseness of Cloud Bigtable tables, and the fact that new column qualifiers can be added on the fly • The username is used as the row key. Assuming usernames are evenly spread across the alphabet, data access will be reasonably uniform across the entire table.. Google BigTable
reserved. Storage Components • Nodes are called ‘Tablet Servers’ • Nodes are shared into blocks of contiguous rows called ‘tablets’ to help balance the load of queries • Tablets are stored on Colossus, Google's file system, in SSTable format • An SSTable provides a persistent, ordered immutable map from keys to values, where both keys and values are arbitrary byte strings • Importantly, data is never stored in Cloud Bigtable nodes themselves; each node has pointers to a set of tablets that are stored on Colossus. Google BigTable
reserved. Setting up Grails • Dependencies, Dependencies • Don’t underestimate library conflicts - google has packaged various grpc libs inside their jars making working with it very difficult • Use Google cloud libs + Apache HBase libs • BigTable Grails App • See https://github.com/grpc/grpc-java/blob/master/SECURITY.md#troubleshooting for a chart to help match library versions Google BigTable
reserved. “Enterprise Level Message Oriented Middleware” • Typical Topic/Subscriber/Publisher Model • Supports either push or pull model • BigTable Grails App Google PubSub
reserved. Overview • Google Cloud Pub/Sub is a publish/subscribe (Pub/Sub) service: a messaging service where the senders of messages are decoupled from the receivers of messages. There are several key concepts in a Pub/Sub service: • Message • Topic • Subscription • Publisher • Subscriber Google PubSub
reserved. Running projects cost money! • If you are using above 28 instance hours you will eat into your $300 credit • Unfortunately no ‘suspend’ or easy off like AWS :( • Delete project • Delete App Versions • Delete Cloud SQL Instances • Delete Cloud Storage Buckets Cleanup
39 Process Alternate Process Data Begin No Yes Terminator/ End Connector Shapes Lines Text Boxes Use Insert > Shapes > Flow Chart and Lines for additional shape and line options. Decision FLOWCHART ELEMENTS
STEP 1 Copy and paste Slide 30 and modify text as needed Or copy and paste the shapes to build a graphic that highlights percentages or other statistics TIPS Build a photo background, or set the layout to Photo Background (blue gradient) Headline text should be sized at 42-48 point Highlighted number should be sized at 30-33 point Neighboring text box should use text sized to 20-22 point, and should be centered under the circle