Introducing “Serverless Migration Station” Learning Modules

Posted by Wesley Chun (@wescpy), Developer Advocate, Google Cloud

graphic showing movement with arrows,. settings, lines, and more

Helping users modernize their serverless apps

Earlier this year, the Google Cloud team introduced a series of codelabs (free, online, self-paced, hands-on tutorials) designed for technical practitioners modernizing their serverless applications. Today, we’re excited to announce companion videos, forming a set of “learning modules” made up of these videos and their corresponding codelab tutorials. Modernizing your applications allows you to access continuing product innovation and experience a more open Google Cloud. The initial content is designed with App Engine developers in mind, our earliest users, to help you take advantage of the latest features in Google Cloud. Here are some of the key migrations and why they benefit you:

  • Migrate to Cloud NDB: App Engine’s legacy ndb library used to access Datastore is tied to Python 2 (which has been sunset by its community). Cloud NDB gives developers the same NDB-style Datastore access but is Python 2-3 compatible and allows Datastore to be used outside of App Engine.
  • Migrate to Cloud Run: There has been a continuing shift towards containerization, an app modernization process making apps more portable and deployments more easily reproducible. If you appreciate App Engine’s easy deployment and autoscaling capabilities, you can get the same by containerizing your App Engine apps for Cloud Run.
  • Migrate to Cloud Tasks: while the legacy App Engine taskqueue service is still available, new features and continuing innovation are going into Cloud Tasks, its standalone equivalent letting users create and execute App Engine and non-App Engine tasks.

The “Serverless Migration Station” videos are part of the long-running Serverless Expeditions series you may already be familiar with. In each video, Google engineer Martin Omander and I explore a variety of different modernization techniques. Viewers will be given an overview of the task at hand, a deeper-dive screencast takes a closer look at the code or configuration files, and most importantly, illustrates to developers the migration steps necessary to transform the same sample app across each migration.

Sample app

The baseline sample app is a simple Python 2 App Engine NDB and webapp2 application. It registers every web page visit (saving visiting IP address and browser/client type) and displays the most recent queries. The entire application is shown below, featuring Visit as the data Kind, the store_visit() and fetch_visits() functions, and the main application handler, MainHandler.


import os
import webapp2
from google.appengine.ext import ndb
from google.appengine.ext.webapp import template

class Visit(ndb.Model):
'Visit entity registers visitor IP address & timestamp'
visitor = ndb.StringProperty()
timestamp = ndb.DateTimeProperty(auto_now_add=True)

def store_visit(remote_addr, user_agent):
'create new Visit entity in Datastore'
Visit(visitor='{}: {}'.format(remote_addr, user_agent)).put()

def fetch_visits(limit):
'get most recent visits'
return (v.to_dict() for v in Visit.query().order(
-Visit.timestamp).fetch(limit))

class MainHandler(webapp2.RequestHandler):
'main application (GET) handler'
def get(self):
store_visit(self.request.remote_addr, self.request.user_agent)
visits = fetch_visits(10)
tmpl = os.path.join(os.path.dirname(__file__), 'index.html')
self.response.out.write(template.render(tmpl, {'visits': visits}))

app = webapp2.WSGIApplication([
('/', MainHandler),
], debug=True)

Baseline sample application code

Upon deploying this application to App Engine, users will get output similar to the following:

image of a website with text saying VisitMe example

VisitMe application sample output

This application is the subject of today’s launch video, and the main.py file above along with other application and configuration files can be found in the Module 0 repo folder.

Next steps

Each migration learning module covers one modernization technique. A video outlines the migration while the codelab leads developers through it. Developers will always get a starting codebase (“START”) and learn how to do a specific migration, resulting in a completed codebase (“FINISH”). Developers can hit the reset button (back to START) if something goes wrong or compare their solutions to ours (FINISH). The hands-on experience helps users build muscle-memory for when they’re ready to do their own migrations.

All of the migration learning modules, corresponding Serverless Migration Station videos (when published), codelab tutorials, START and FINISH code, etc., can all be found in the migration repo. While there’s an initial focus on Python 2 and App Engine, you’ll also find content for Python 3 users as well as non-App Engine users. We’re looking into similar content for other legacy languages as well so stay tuned. We hope you find all these resources helpful in your quest to modernize your serverless apps!

Connect to your Amazon CloudWatch data to detect anomalies and diagnose their root causes using Amazon Lookout for Metrics

We are excited to announce that Amazon Lookout for Metrics now allows you to detect anomalies on your Amazon CloudWatch data. Amazon Lookout for Metrics uses machine learning (ML) to automatically detect and diagnose anomalies (outliers from the norm) without requiring any prior ML experience. Amazon CloudWatch provides you with actionable insights to monitor your applications, respond to system-wide performance changes, optimize resource utilization, and get a unified view of operational health.

Amazon Keyspaces (para Apache Cassandra) ahora ayuda a monitorear y mejorar el rendimiento de lectura/escritura de la aplicación, así como la capacidad de producción, mediante el uso de nuevas métricas de Amazon CloudWatch

Amazon Keyspaces (para Apache Cassandra), un servicio de base de datos compatible con Apache Cassandra, escalable, de alta disponibilidad y completamente administrado, ahora ayuda a monitorear y mejorar el rendimiento de lectura/escritura de la aplicación, así como la capacidad de producción, mediante el uso de nuevas métricas de Amazon CloudWatch.

Amazon Connect Customer Profiles launches in Canada(Central) region

Amazon Connect now allows you to enable Amazon Connect Customer Profiles in Canada (Central) region, equipping contact center agents with the most up to date information about the incoming contact to provide faster and more personalized customer service. Customer Profiles automatically brings together customer information from multiple applications such as Salesforce, Amazon S3 and ServiceNow into a unified customer profile, delivered to agents at the beginning of the customer interaction. 

AWS Gateway Load Balancer ahora se encuentra disponible en las regiones AWS GovCloud (EE. UU.)

AWS Gateway Load Balancer está disponible ahora en las regiones AWS GovCloud (EE. UU.). Gracias a la expansión a la región de AWS GovCloud (EE. UU.), las agencias gubernamentales de EE. UU. y sus subcontratistas podrán trasladar a la nube cargas de trabajo con un mayor nivel de confidencialidad al disponer de ayuda para abordar sus requisitos específicos de conformidad y normativos. Con este lanzamiento, AWS Gateway Load Balancer ya está disponible en 25 regiones.

Amazon Aurora PostgreSQL es compatible con la extensión pg_partman para la administración de particiones de tablas basadas en ID de serie o tiempo

La edición de Amazon Aurora compatible con PostgreSQL soporta la extensión del administrador de particiones (pg_partman). Se trata de una extensión de PostgreSQL que le ayuda a administrar conjuntos de particiones de tablas basadas tanto en series temporales como en series, lo cual incluye la administración automática de la creación de particiones y el mantenimiento del tiempo de ejecución. pg_partman funciona con la partición nativa de PostgreSQL, de modo que los usuarios pueden beneficiarse de mejoras del rendimiento significativas.

Amazon Aurora PostgreSQL es compatible con la extensión pg_proctab para acceder a las estadísticas de sistema de PostgreSQL

La edición de Amazon Aurora compatible con PostgreSQL incorpora compatibilidad con la extensión pg_proctab. Dicha extensión es una recopilación de funciones almacenadas que pueden acceder a la tabla de procesos de sistemas operativos, de modo que se pueden realizar consultas de las estadísticas del sistema mediante la base de datos. Las funciones de pg_proctab hacen que sea más fácil recopilar datos de su base de datos de PostgreSQL, incluida información actualizada sobre estadísticas del procesador u operaciones de E/S en consultas de SQL, lo cual facilita la resolución de problemas.