A VM is a VM is a VM (or is it?)

Don’t believe innovation is strong in the IaaS VM space? Read on.

When I hear that all IaaS clouds were created equal I feel like a decade or so ago arguing that Solaris 10 was actually bring lots of innovation to the operating system market (Dtrace, ZFS, Zones). Google’s Compute Engine is adding unique features one at a time to the point where flexibility is really the real reason to move to the cloud.


It all starts with the ability to create your VM using custom machine types rather than having to chose from a pre-defined set of configurations. You can also change the characteristics of an existing machine – more memory, more CPU to adjust to different requirements or when moving from development to production. Then, the boot time has been repeatedly measured as being extremely fast which really relates to how flexible a cloud environment should be.

When running your VM, you can rely on live migration voodoo to keep your services running (while, for instance, Google upgrades the underlying infrastructure) as well as wonderful local SSD performance. Performance, reliability, flexibility. Choose three.

Price is always important and since you don’t have time to become a billing expert, Compute Engine is priced by the minute (so you truly pay for what you use), offers automatic discounts on sustained use and a crazy-cheap option with preemptible VMs. Customers of course benefit from the pricing competition and Google is committed to providing the best value.

Of course there are many other things that make Compute Engine attractive including Google’s networking infrastructure, the new UX-friendly Console with great in-browser SSH support, and of course all the higher-level services such as Container Engine (hosted Kubernetes). But at the end of the day what matters is that innovation and competition are alive and well.

Google works hard to make sure not all Cloud VMs are created equal but you should check out for yourself – you’re just minutes away from SSH’ing into your own Compute Engine VM.

Summer 2016 update: you can not also get sizing recommendations from Google to better optimize your instances, including those you should scale down!

Google Developer Live – Tous les contenus, tous les jours

Google Developer Live (GDL) a été lancé peu de temps avant Google I/O 2012 et propose du contenu technique sous forme de vidéos: courtes démonstrations, webinars, présentations complètes ou office hours, qui sont elles interactives par nature avec l’utilisation de hangout on Air (discussion dans un Google + Hangout, (re)diffusion et avec YouTube).

Les sujets traités vont de Android à Chrome en passant par Google+, AppEngine, YouTube, Maps et autres APIs Google.

Coté Cloud, il y a par exemple cette courte présentation des différentes solutions de stockage (Cloud Storage, Datastore et Cloud SQL) et de requêtage (REST, SQL, BigQuery). Il y a aussi des formats plus longs comme ce tutorial sur l’API Search d’AppEngine, un tutorial interactif sur l’API Google MAPS, cette session sur le language Dart couplée à une série de questions sur Google Moderator ou encore ces réflexions de Robert Scoble sur le monde des startups.

Coté Android, il y a les Office Hours (horaire Européen) pour poser ses questions et les Friday App Review (ici avec Reto Meier).

Vous trouverez un agenda complet sur le site Google Developer Live ainsi que tous le contenu archivé sur YouTube. Il se passe quelque chose tous les jours!

“Bon, et le contenu en français c’est pour quand?” Stay tuned!

Google Developer Expert (GDE) en France

Parmi les annonces que vous n’avez peut-être pas vu passer lors de Google I/O 2012, il y a le programme Google Developer Experts.

Avec ce nouveau programme, Google propose à des individus d’obtenir un titre d’expert à l’année pour l’un des domaines de prédilection de Google (Android, Cloud, HTML5, Chrome, Social, Geo, etc…).

Il ne s’agit bien entendu pas d’un rôle de porte-parole mais plus d’une reconnaissance apportée à une personne à la fois technique, experte et visible (présentations publiques, blog, commits, etc…). Ce titre lui permettra d’entretenir une relation avec Google (contact avec les developer advocates, access aux previews et plus encore) et de présenter lors de conférences développeurs.

Initiallement piloté en Israel et au Japon, le programme est désormais publique et actif en France comme l’indique la page des Experts actifs. Sa gestion est effectuée localement par Google France.

Maj: voici un billet sur GDE rédigé par le responsable du program au niveau mondial.

CloudSQL for the busy Java Developer

CloudSQL, Google’s fully-managed and highly-available MySQL-based relational database service, can be accessed directly by Java IDE’s or used as a target for on-premise running Java application servers, and of course it can be seamlessly used from AppEngine Java applications. Here’s how.


This paper assumes you have a CloudSQL database instance configured and (ideally) populated. You should have authorized your local machine using OAuth and the command-line tool and have the CloudSQL JDBC driver handy (it’s in the AppEngine SDK in lib/impl). If you need help on any of this, consider reading this Getting Started paper.

Here are the values used here :

  1. Cloud SQL instance name : scott-tiger:scott
  2. Database Name : jpetstore
  3. JDBC Driver Class Name : com.google.cloud.sql.Driver
  4. JDBC URL : jdbc:google:rdbms://scott-tiger:scott/jpetstore

By default the CloudSQL instance can be accessed with user root and an empty password.

This paper uses NetBeans (7.x) as the IDE and GlassFish (ships with NetBeans) as the local Java Application Server but everything should be easily adaptable for other tools such as Eclipse and other runtimes (tomcat, JBoss, etc).

NetBeans & CloudSQL

The NetBeans IDE offers a JDBC database explorer feature which you can use to access your CloudSQL database instance. In the NetBeans Services tab, chose Databases > Drivers and create a new driver configuration by pointing to the google_sql.jar archive and using com.google.cloud.sql.Driver as the JDBC driver name (should be auto-detected). Right-click this newly created JDBC driver and select “Connect With…” to create a new connection. Provide the username, the password and the full JDBC URL (jdbc:google:rdbms://scott-tiger:scott/jpetstore in my case) and test the connection.

You should now be able to navigate the database schema, view table content, manipulate data, and execute any SQL statement.

WebApp Project

We’ll now create a web application using JPA entities manipulating data from the Cloud SQL instance discussed above. We’ll deploy this application first to GlassFish, then to App Engine.

Within NetBeans, create a (Maven) Web Application project with GlassFish as the default target. Right-click on the project to select the “New Entity Classes from Database” wizard. Create a new data source using the JDBC connection defined in the previous step. Select the tables you want to create JPA entities for and do not check the “Create Persistence Unit” option (we’ll get back to this later). This generates standard JPA 2.0 @Entity-annotated classes for every table selected from CloudSQL.

Here’s a proper persistence.xml that will work with CloudSQL. Notice how this JPA persistence unit uses RESOURCE_LOCAL and not a JTA data source :

<persistence version="2.0">
  <persistence-unit name="CloudSQLPU" transaction-type="RESOURCE_LOCAL">
      <property name="javax.persistence.jdbc.url" value="jdbc:google:rdbms://scott-tiger:scott/jpetstore"/>
      <property name="javax.persistence.jdbc.user" value="user"/>
      <property name="javax.persistence.jdbc.password" value="pw"/>
      <property name="javax.persistence.jdbc.driver" value="com.google.cloud.sql.Driver"/>

Once this is setup, you can get a hold of this persistence unit in the servlet created by default the typical way you would in an servlet :

EntityManagerFactory emf = 
EntityManager em = emf.createEntityManager();

A simple use to exercise the data could be to list all the names stored in the Category table (using its JPA entity representation) :

CriteriaQuery cq = em.getCriteriaBuilder().createQuery();
List<Category> categories = em.createQuery(cq).getResultList();

for (Category category : categories) {
    out.println(category.getName() + "<br/>");

Deploying this simple application to the GlassFish application server shouldn’t require any other changes. Obviously with this architecture, the performance is not ideal given the server is not exactly close to the data. Nevertheless, this demonstrates the standalone capabilities of CloudSQL

Ship it all to the cloud!

A better approach is to probably to use CloudSQL from a Google AppEngine-hosted application where all sorts of optimisations will quick in. To do so, only limited changes to the standard application described above are required.

The first simple change is to add the AppEngine-specific deployment descriptor appengine-web.xml :

<?xml version="1.0" encoding="UTF-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0"

You’ll also need to change the name of the JDBC driver in persistence.xml (a more elegant solution could be to use Maven profiles to keep the project fully portable) :

- <property name="javax.persistence.jdbc.driver"
-          value="com.google.cloud.sql.Driver"/>
+ <property name="javax.persistence.jdbc.driver"
+         value="com.google.appengine.api.rdbms.AppEngineDriver"/>;

The JDBC URL remains the same.

Finally, you’ll need to bundle JPA / EclipseLink and BeanValidation / Hibernate Validator by making them runtime-scope dependencies. The Servlet and AppEngine SDK API artifacts should use the default scoping. Your mileage may vary when it comes to the implementation versions. Here is my complete set of Maven dependencies :


Make sure the AppEngine application is authorized to access the CloudSQL instance (use the API Console for that). Once this is all done, simply deploy the application to AppEngine :

$ appcfg.sh update target/MyCloudSQLApp-1.0.0-SNAPSHOT

You’ll find the CloudSQL developer documentation here.

Devoxx France. Wild Success!

I’ve been on the job for less than a month and so far I seem to be experiencing the “and suddenly everything accelerates” sentiment.

Part of the acceleration was the Devoxx conference for the first time in Paris after 10 yearly occurrences in Antwerp. It was my first time attending such a major developer conference in my home town and I took pride in having had the same shitty weather as in Belgium in November ;)

Joking aside, this 1200-participant event was a success by many metrics, not only was it sold out, but I believe it had the right level of content with labs, university sessions, inspiring keynotes (ok, not all of them), regular sessions, and of course socializing.

I’ve spent most of my time at the conference catching up with friends, meeting many new faces (quick, someone, give me glasses with face recognition!) and explaining my responsibilities in the new job.

Kudos to my colleague Martin Görner who had driven the project on the Google side for many weeks now. Speaking of Martin, you can look at his G+ page to see how active the Google booth was with PAUG and Paris GTUG-selected developer demos. Developers talking to developers!

On a somewhat more personal note, it felt great to see Ludo again (now working on AppEngine) as well as Romain Guy, Android Diva (in a good sense!). Meeting new colleagues (Petra, Nicolas, and others) was another highlight.

Devoxx is turning out to be a wild success across Europe. Can’t wait to spread more Google Developer love in future events!