SlideShare une entreprise Scribd logo
1  sur  82
Gaelyk: Groovy Coding to the Cloud

Guillaume Laforge
Groovy Project Manager
SpringSource, a division of VMware


Twitter: @glaforge
Blog: http://glaforge.appspot.com


© 2011 SpringOne 2GX 2011. All rights reserved. Do not distribute without permission.
Guillaume Laforge

• Groovy Project Manager at VMware
    • Initiator of the Grails framework
    • Creator of the Gaelyk toolkit
• Co-author of Groovy in Action
• Speaking worldwide w/ a French accent


• Follow me on...
    • My blog: http://glaforge.appspot.com
    • Twitter: @glaforge
    • Google+: http://gplus.to/glaforge


2        @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Guillaume Laforge

• Groovy Project Manager at VMware
    • Initiator of the Grails framework
    • Creator of the Gaelyk toolkit
• Co-author of Groovy in Action
• Speaking worldwide w/ a French accent


• Follow me on...
    • My blog: http://glaforge.appspot.com
    • Twitter: @glaforge
    • Google+: http://gplus.to/glaforge


2        @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Introduction to Google App Engine




© 2011 SpringOne 2GX 2011. All rights reserved. Do not distribute without permission.
IaaS, PaaS, SaaS



• Software as a Service
    – Gmail, SalesForce.com
                                                                       SaaS
• Platform as a Service
    – Google App Engine
                                                                       PaaS
    – -CloudFoundry


• Infrastructure as a Service
                                                                         IaaS
    – Amazon EC2
4       @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
IaaS, PaaS, SaaS



• Software as a Service
    – Gmail, SalesForce.com
                                                                       SaaS
• Platform as a Service
    – Google App Engine
                                                                       PaaS
    – -CloudFoundry


• Infrastructure as a Service
                                                                         IaaS
    – Amazon EC2
4       @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
IaaS, PaaS, SaaS



• Software as a Service
    – Gmail, SalesForce.com
                                                                       SaaS
• Platform as a Service
    – Google App Engine
                                                                       PaaS
    – -CloudFoundry


• Infrastructure as a Service
                                                                         IaaS
    – Amazon EC2
4       @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Google App Engine

• Google’s PaaS solution
    – Run your app on Google’s infrastructure


• Initially just Python supported


• Java support added too
    – Sandboxed JVM
    – Jetty servlet container


• Several JVM-compatible language supported

5        @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Key aspects

• You can use most of your usual web frameworks for
  developping apps on App Engine Java
    – A WAR file, basically! (an exploded war actually)
    – Uploading to the cloud by sending deltas of changes

• No OS image, or software to install
    – Unlike with Amazon EC2

• All the scaling aspects are handled for you
    – Database / session replication, load balancing...

• There are quotas, but you need a medium traffic application
  to start being charged

6        @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Some of the available services

• Memcache
    – JCache implementation                             • XMPP
    – Save on CPU and datastore                            – Send / receive Jabber
                                                             messages (GTalk)
• URL Fetch
    – Access remote resources                           • User
    – HttpUrlConnection                                    – Use Google’s user/
                                                             authentication system
• Mail                                                     – OAuth support
    – Support both incoming and
                                                        • Cron & Task queues
      outgoing emails
                                                           – Schedule tasks at regular
• Images                                                     intervals
    – Resize, crop, rotate...                              – Queue units of work


7         @glaforge — http://glaforge.appspot.com   —    http://gplus.to/glaforge
Limitations

• Time and size limits
    – 60 second requests — was 30s
    – 60 second / 5MB URLFetch — was 10s / 1MB
    – 10K files / 32MB each — was 3K files / 10MB each


                              • Forbidden to
                              – write on the file system
                              – create threads
                              – use raw sockets
                              – issue system calls
                              – use IO / Swing / etc. directly

8       @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Quotas & Billing




9    @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Free tier
No infinite
 scaling!
No more
usage based
Paid tier w/
 free quota
Support!
Reduced quotas
The Datastore
The datastore...

• Distributed key / value store
     – Based on Google’s «BigTable»
     – Schema-less approach


• Supporting
     – Transactions and partitioning
     – Hierarchies through entity groups



• Data access APIs
     – JPA and JDO
        • but adds a big request load time factor


13         @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
...and its «limitations»

• You’re not using SQL
     – No joins
     – No database constraints
     – No aggregation functions (count, avg...)
     – But there’s a preview for a «Cloud SQL»


• Only filter on one column for inequality in queries
• Transactions only available in entity groups
     – cross group transactions are coming though
• You can only update an entity once in a transaction


14        @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Nice dashboard
Now... letʼs dive into Gaelyk!




© 2011 SpringOne 2GX 2011. All rights reserved. Do not distribute without permission.
http://gaelyk.appspot.com




                       F
http://gaelyk.appspot.com




                       F
• Gaelyk is a lightweight Groovy toolkit on top of the
  Google App Engine Java SDK


• Gaelyk builds on Groovy’s servlet support
     – Groovlets: Groovy scripts instead of raw servlets!
     – Groovy templates: JSP-like template engine
     – Both allow for a clean separation of views and logic


• Gaelyk provides several enhancements around the GAE
  Java SDK to make life easier, thanks to Groovy’s dynamic
  nature
18        @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Why Groovy?


• Groovy is a dynamic language for the JVM
     – very flexible, malleable, expressive and concise syntax
     – easy to learn for Java developers
       • deriving from the Java 5 grammar
     – provides powerful APIs to simplify the life of developers
       • possibility to dynamically enrich existing APIs
     – support for Groovlets and its own template engine




19        @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
First steps...



• Go to http://gaelyk.appspot.com
• Download the template project
• Put your first Groovlet in /WEB-INF/groovy
• And your templates in /WEB-INF/pages
• And you’re ready to go!
• Launch dev_appserver.sh
• Go to http://localhost:8080/
The web.xml

                                                                     ">
     <web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5
       <listener>
                                                                      /servlet-class>
         <listener-class>groovyx.gaelyk.GaelykServletContextListener<
       </listener>
       <servlet>
         <servlet-name>GroovletServlet</servlet-name>
         <servlet-class>groovyx.gaelyk.GaelykServlet</servlet-class>
       </servlet>
       <servlet>
         <servlet-name>TemplateServlet</servlet-name>
                                                                      -class>
         <servlet-class>groovyx.gaelyk.GaelykTemplateServlet</servlet
       </servlet>

       <servlet-mapping>
         <servlet-name>GroovletServlet</servlet-name>
         <url-pattern>*.groovy</url-pattern>
       </servlet-mapping>
       <servlet-mapping>
         <servlet-name>TemplateServlet</servlet-name>
         <url-pattern>*.gtpl</url-pattern>
       </servlet-mapping>
     </web-app>



21       @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
MVC: Groovlets and templates




           Groovlets                                           Templates
          (controllers)                                          (views)




                                     Entities
                                    (domain)




    @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
A groovlet

• Instead of writing full-blown servlets, just write Groovy
  scripts (aka Groovlets)


            def numbers = [1, 2, 3, 4]
            def now = new Date()

            html.html {
                body {
                    numbers.each { number -> p number }
                    p now
                }
            }




23     @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
A groovlet

• Instead of writing full-blown servlets, just write Groovy
  scripts (aka Groovlets)


            def numbers = [1, 2, 3, 4]
            def now = new Date()

            html.html {
                body {
                    numbers.each { number -> p number }
                    p now
                }
                                                                                     di ng
                                                                                   oa
            }

                                                                        -r      el
                                                                     to
                                                              Au
23     @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
A template

            <html>
                <body>
                     <p><%
                         def message = "Hello World!"
                         print message %>
                     </p>
                     <p><%= message %></p>
                     <p>${message}</p>
                     <ul>
                     <% 3.times { %>
                          <li>${message}</li>
                     <% } %>
                     </ul>
                 </body>
             </html>


24   @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
A template

            <html>
                <body>
                     <p><%
                         def message = "Hello World!"
                         print message %>
                     </p>
                     <p><%= message %></p>
                     <p>${message}</p>
                     <ul>
                     <% 3.times { %>
                          <li>${message}</li>
                     <% } %>
                                                                                   di ng
                     </ul>
                                                                              el oa
                 </body>
                                                                   to -r
                                                            Au
             </html>


24   @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Shortcuts

• Google services                                         – namespace
     – datastore, blobstore                             • Variables available
     – backends, lifecycle                                  – request / response
     – memcache                                             – context / application
     – capabilities                                         – sessions
     – images                                               – params / headers
     – urlFetch                                             – out / sout / html
     – mail                                                 – localMode / app.*
     – userService / user
     – defaultQueue / queues                            • Methods available
     – xmpp                                                 – include / forward / redirect
25        @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Groovy sugar!
Sending emails with Gaelyk



     mail.send to:                 'to@gmail.com',
             from:                 'other@gmail.com',
          subject:                 'Hello World',
         htmlBody:                 '<bold>Hello</bold>'




27   @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
...compared to Java

     Properties props = new Properties();
                                                         , null);
     Sessio n session = Session.getDefaultInstance(props

     try {
         Message msg = new MimeMessage(session);
                                                         om"));
         msg .setFrom(new InternetAddress("other@gmail.c
                                                  O,
         msg.addRecipient(Message.RecipientType.T
                                                 o@example.com"));
                          new InternetAddress("t
         msg.setSubject("Hello World");
         msg.setText("<bold>Hello</bold>");
         Transport.send(msg);
     } catch (AddressException e) {}
     } catch (MessagingException e) {}




28      @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Unfair comparision?




29   @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Unfair comparision?




29   @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Unfair comparision?




29   @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Accessing the datastore

• Direct interaction with the low-level datastore API
              Entity entity = new Entity("person")
               
                                                           map
              // subscript notation, like when accessing a
              entity['name'] = "Guillaume Laforge"
               
              // normal property access notation
              entity.age = 32

              entity.save()   // asyncSave()
              entity.delete() // asyncDelete()

              datastore.withTransaction {
                  // do stuff with your entities
                  // within the transaction
              }

              // use the asynchronous datastore service
              datastore.async.put(entity)


30     @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Querying the datastore

• Before... (Java-style)
     import com.google.appengine.api.datastore.*
                                                                        der.*
     import static com.google.appengine.api.datastore.FetchOptions.Buil
      
     // query the scripts stored in the datastore
     def query = new Query("savedscript")
      
     // sort results by descending order of the creation date
     query.addSort("dateCreated", Query.SortDirection.DESCENDING)
      
                                                                        author
     // filters the entities so as to return only scripts by a certain
                                                                        r)
     query.addFilter("author", Query.FilterOperator.EQUAL, params.autho
      
     PreparedQuery preparedQuery = datastore.prepare(query)
      
     // return only the first 10 results
     def entities = preparedQuery.asList( withLimit(10) )



31        @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Querying the datastore... Groovy style!

• After...
                   def entities = datastore.query {
                       select all from savedscript
                       sort desc by dateCreated
                       where author == params.author
                       limit 10
                   }




• SQL-like query DSL
     – select: ‘all’, ‘count’, ‘single’, ‘keys’
     – from: entityName as SomeClass

32         @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
@GaelykBinding

• The various services and variables are injected in the
  binding of Groovlets and Templates
     – but were not accessible from plain classes
• The transformation @GaelykBinding injects those variables
      import
groovyx.gaelyk.GaelykBindings
      

      //
annotate
your
class
with
the
transformation
      @GaelykBindings
      class
WeblogService
{
      



def
numberOfComments(post)
{
      







//
the
datastore
service
is
available
      







datastore.execute
{
      











select
count
from
comments
where
postId
==
post.id
      







}
      



}
      }


33        @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
URL Routing system

• You can have friendly URL mappings
  with the URL routing system
     all "/aboutus",
         redirect: "/blog/2008/10/20/about-us"

     all "/blog/@year/@month/@day/@title",
                                                                 y@title=@title"
         for ward: "/blog.groovy?year=@year&month=@month@day=@da

     get "/blog/@year/@month/@day",
                                                             @day"
         forward: "/blog.groovy?year=@year&month=@month@day=

     get "/book/isbn/@isbn",
         forward: "/book.groovy?isbn=@isbn",
         validate: { isbn ==~ /d{9}(d|X)/ }




34         @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
URL Routing system


                                                                  2.5">
     <web-app xmlns="http://java.sun.com/xml/ns/javaee" version="
       ...
       <filter>
         <filter-name>RoutesFilter</filter-name>
                                                                      ss>
         <filter-class>groovyx.gaelyk.routes.RoutesFilter</filter-cla
       </filter>

       <filter-mapping>
         <servlet-name>RoutesFilter</servlet-name>
         <url-pattern>/*</url-pattern>
       </filter-mapping>
       ...
     </web-app>




35         @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
URL Routing system

• You can also define caching times

        get "/aboutus", cache: 24.hours,
            forward: "/aboutus.gtpl"

         get "/breaking-news", cache: 1.minute,
             forward: "/news.groovy?last=10"




     – Nice for GAE’s infamous «loading requests»
       • less critical since GAE SDK 1.4
          – warmup requests
36       @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
URL Routing system

• Special routes for specifying
     – incoming emails
     – jabber chat messages
     – jabber presence and subscription messages

         email to: "/incomingMail.groovy"

         jabber to: "/incomingXmpp.groovy"
         // synonym: jabber chat, to: "..."

          jabber presence, to: "/subs.groovy"
          jabber subscrpition, to: "/subs.groovy"


37       @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
URL Routing system

• Namespace awareness: nice for multitenancy
• Capability awareness: for graceful degradation
     // @cust customer variable could be « acme »
     post "/@cust/update", forward: "/update.groovy",
                          namespace: { "ns-$cust" }

                                                           es status
     // different destinations depending on the GAE servic
     get "/speakers", forward {
         to "/speakers.groovy" // default destination
         // when the datastore is not available
         to "/unavailable.gtpl" on DATASTORE not ENABLED
         // show some maintenance is upcoming
                                                                
         to "/speakers.groovy?maintenance=true" on DATASTORE
                 is SCHEDULED_MAINTENANCE
     }


38       @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Capabilities

• Google App Engine allows you to know the status and
  availability of the various services
     – DATASTORE, DATESTORE_WRITE, MEMCACHE...
     – ENABLED, DISABLED, UNKNOWN,
       SCHEDULED_MAINTENANCE
     – is() and not() methods

      if (capabilities[DATASTORE_WRITE].is(ENABLED)) {
          // write some content in the datastore
      } else {
          // otherwise, redirect to some maintenance page
      }



39        @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Task queue API

     // access a configured queue using the subscript notation
     queues['dailyEmailQueue']
      
     // or using the property access notation
     queues.dailyEmailQueue
      
     // you can also access the default queue with:
     queues.default
     defaultQueue

     // add a task to the queue
     queue << [
         countdownMillis: 1000, url: "/task/dailyEmail",
         taskName: "sendDailyEmailNewsletter",
         method: 'PUT', params: [date: '20090914'],
         payload: content
     ]


40   @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Jabber / XMPP support (1/3)

• Sending instant messages

     String recipient = "someone@gmail.com"
      
     // check if the user is online
     if (xmpp.getPresence(recipient).isAvailable()) {
         // send the message
         def status = xmpp.send to: recipient,
                              body: "Hello, how are you?"
      
             // checks the message was successfully
             // delivered to all the recipients
             assert status.isSuccessful()
     }



41       @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Jabber / XMPP support (2/3)

• Sending instant messages with an XML payload

     String recipient = "service@gmail.com"
      
     // check if the service is online
     if (xmpp.getPresence(recipient).isAvailable()) {
         // send the message
         def status = xmpp.send to: recipient, xml: {
             customers {
                 customer(id: 1) {
                     name 'Google'
                 }
             }
         }
      
         // checks the message was successfully delivered to the service
         assert status.isSuccessful()
     }



42      @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Jabber / XMPP support (2/3)

• Sending instant messages with an XML payload

     String recipient = "service@gmail.com"
      
     // check if the service is online
     if (xmpp.getPresence(recipient).isAvailable()) {
         // send the message
         def status = xmpp.send to: recipient, xml: {
             customers {
                 customer(id: 1) {          <customers>
                     name 'Google'              <customer id=’1’>
                 }                                  <name>Google</name>
             }                                  </customer>
         }                                  </customers>
      
         // checks the message was successfully delivered to the service
         assert status.isSuccessful()
     }



42      @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Jabber / XMPP support (3/3)

• Receving incoming instant messages
     – Once you’ve configured a route for jabber messages
     – Add the inbound message service in appengine-web.xml
      def message = xmpp.parseMessage(request)
      // get the body of the message
      message.body
      // get the sender Jabber ID
      message.from
      // get the list of recipients Jabber IDs
      message.recipients
       
      // if the message is an XML document instead of a raw string message
      if (message.isXml()) {
          // get the raw XML
          message.stanza
          // get a document parsed with XmlSlurper
          message.xml
      }


43        @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Memcache service

• Map notation access to the cache

                                                        }
     class Country implements Serialzable { String name
      
     def countryFr = new Country(name: 'France')
      
                                                           in the cache
     // use the subscript notation to put a country object
     // (you can also use non-string keys)
     memcache['FR'] = countryFr
      
     // check that a key is present in the cache
     if ('FR' in memcache) {
                                                            the cache using a key
         // use the subscript notation to get an entry from
         def countryFromCache = memcache['FR']
     }




44         @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Closure memoization

• Cache the return values for each dinstinct invocation
  (for a given arguments set)

                                                        ->
     def countEntities = memcache.memoize { String kind
         datastore.prepare( new Query(kind) )
                  .countEntities()
     }

     // first call
     def totalPics = countEntityes('photos')

     // second call, hitting the cache
     totalPics = countEntityes('photos')



45     @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Blobstore enhancements

• The blobstore allows to store some large content
     – images, videos, etc.

       def blob = ...
       print blob.filename // contentType, creation, size

       // output the content of the blob to the response
       blob.serve response

       // read the content of the blob
       blob.withReader { Reader r -> ... }
       blob.withStream { InputStream is -> ... }

       // delete the blob
       blob.delete()

46        @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
File service

• The file service provides a file-like read/write access over
  blobs from the blobstore services
     – programmatic creation of blobs was an issue before
      def
file
=
files.createNewBlobFile("text/plain",
"hello.txt")

      //
writing
with
a
writer
      file.withWriter
{
writer
‐>
      



writer
<<
"some
content"
      }

      //
writing
binary
content
      file.withOutputStream
{
stream
‐>
      



stream
<<
"some
content".bytes
      }

      //
file.withWriter(encoding:
"US‐ASCII")
      //
file.withWriter(locked:
false,
finalize:
false)

47        @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
File service

• Instead of using the blobstore reading capabilities, you can
  read from the file service

     //
read
from
a
buffered
input
stream
     file.withI nputStream
{
BufferedInputStream
stream
‐>
     



//
read
from
the
stream
     }

     //
read
from
a
buffered
reader
     file.withReader{
BufferedReader
reader
‐>
     



//
read
from
the
reader
     }

     //
locked
and
encoding
params
available
too


48      @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Images service

• Readable DSL for manipulating images

     def blobKey = ...

     def image = blobKey.image.transform {
         resize 1600, 1200
         crop 0.1, 0.1, 0.9, 0.9
         horizontal flip // vertical flip too
         rotate 90
         feeling lucky // image corrections
     }

     def thumbnail = image.resize(100, 100)



49    @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Channel Service

• For Comet-style applications

      def token = channel.createChannel('clientID')
      channel.send 'clientID', 'Hi!'




• Then in the view, in JavaScript...
      channel = new goog.appengine.Channel(token);
      socket = channel.open();
      socket.onmessage = function(msg) { ... }


50     @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Simple plugin system
• Gaelyk features a simple plugin system
  for extending your apps and share commonalities


• A plugin lets you
     – provide additional groovlets and templates
     – contribute new URL routes
     – add new categories
     – define variables in the binding
     – override existing binding variables
     – provide any static content
     – add new libraries
     – do any initialization
51        @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Simple plugin system

• A plugin is actually just a zip file!
     – Basically, just a Gaelyk application, minus...
       • the Groovy / Gaelyk / GAE JARs
       • the web.xml and appengine-web.xml descriptors
     – But with a /WEB-INF/plugins/myplugin.groovy descriptor


• A plugin must be referenced in /WEB-INF/plugins.groovy
  with
     – install myplugin
       • shortcut to /WEB-INF/plugins/myplugin.groovy


52        @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Simple plugin system

• An example plugin descriptor
     – /WEB-INF/plugins/jsonPlugin.groovy
            import
net.sf.json.groovy.*
            

            //
add
new
variables
in
the
binding
            binding
{
                                                                         le
               jsonLibVersion
=
"2.3"









//
a
simple
string
variab
               json
=
new
JsonGroovyBuilder()

//
3rd
party
class
            }
            

            //
add
new
routes
with
the
usual
routing
system
format
            routes
{
                get
"/json",
forward:
"/json.groovy"
            }
            

            //
install
a
category
you've
developped
            categories
jsonlib.JsonlibCategory

             before
{
req,
resp
‐>
...
}
//
or
after
             

             //
any
other
initialization
code
you'd
need


53        @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Summary

• Google App Engine is an interesting PaaS solution
     – Deploying Java apps, as easily as you would with PHP
     – The free tier lets you easily try out the platform
     – But beware of the limitations and lock-in factor


• Gaelyk provides a simplified approach to creating
  Servlet centric webapps in a productive manner
     – Leveraging Groovy’s servlet / template support
       and dynamic capabilities



54        @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Not only me...




Benjamin Muschko                  Vladimír Orany                           Marco Vermeulen


Gradle GAE plugin                 Gradle Gaelyk                            Spock testing
                                  Eclipse plugin                           integration
Gradle Gaelyk plugin
                                  TDD Gaelyk
Gaelyk datastore                  template (w/ Spock
viewer plugin                     & Easyb integration)
                                  Eclipse DSLD file

55      @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
One
more
thing...
CloudFoundry Gaelyk variant




57   @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
CloudFoundry Gaelyk variant



                                                                      p orw are
                                                            Va




58   @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Thank you!




                                        e
                                L aforg pment
                       aume vy Develo
                 Guill Groo                   m
                 Hea d of           g mail.co
                            aforge@
                    mail: gl glaforge                  e
                  E          @              o /glaforg
                  T witter : http://gplus.t
                   Go ogle+:




59   @glaforge — http://glaforge.appspot.com   —   http://gplus.to/glaforge
Q&A — Got questions, Really?




60   © 2011 SpringOne 2GX 2011. All rights reserved. Do not distribute without permission.
Image credits
•    Speed limit : http://www.morguefile.com/archive/display/18492
     Warehouse : http://www.morguefile.com/archive/display/85628
     Check mark: http://www.lnl.infn.it/~epics/WikiDumps/localhost/600px-symbol_ok.svg.png
     Puzzle: http://www.everystockphoto.com/photo.php?imageId=263521
     Light bulb: https://newsline.llnl.gov/retooling/mar/03.28.08_images/lightBulb.png
     Weight balance: http://www.medicalscale1.com/wp-content/uploads/2010/11/balance-weight-scale2.jpg
     Clouds http://www.morguefile.com/archive/display/627059
     http://www.morguefile.com/archive/display/625552
     http://www.morguefile.com/archive/display/629785
     Duke ok GAE http://weblogs.java.net/blog/felipegaucho/archive/ae_gwt_java.png
     Python logo : http://python.org/images/python-logo.gif
     Gaelic cross with clouds : http://www.morguefile.com/archive/display/37889
     Snow foot steps : http://www.flickr.com/photos/robinvanmourik/2875929243/
     Sugar : http://www.flickr.com/photos/ayelie/441101223/sizes/l/
     Press release: http://www.napleswebdesign.net/wp-content/uploads/2009/06/press_release_11.jpg
     Steve Jobs http://blogs.lentreprise.com/auto-entrepreneur/wp-content/blogs.dir/233/files/2010/07/Steve_Jobs_WWDC07.jpg
     Duke Nukem Forever http://img.jeuxvideo.fr/photo/00704014-photo-duke-nukem-forever.jpg




61                @glaforge — http://glaforge.appspot.com                            —     http://gplus.to/glaforge

Contenu connexe

Tendances

Frontend Performance: De débutant à Expert à Fou Furieux
Frontend Performance: De débutant à Expert à Fou FurieuxFrontend Performance: De débutant à Expert à Fou Furieux
Frontend Performance: De débutant à Expert à Fou FurieuxPhilip Tellis
 
Frontend Performance: Beginner to Expert to Crazy Person
Frontend Performance: Beginner to Expert to Crazy PersonFrontend Performance: Beginner to Expert to Crazy Person
Frontend Performance: Beginner to Expert to Crazy PersonPhilip Tellis
 
PyCon Korea - Real World Graphene
PyCon Korea - Real World GraphenePyCon Korea - Real World Graphene
PyCon Korea - Real World GrapheneMarcin Gębala
 
Virtual CD4PE Workshop
Virtual CD4PE WorkshopVirtual CD4PE Workshop
Virtual CD4PE WorkshopPuppet
 
perlbrew yapcasia 2010
perlbrew yapcasia 2010perlbrew yapcasia 2010
perlbrew yapcasia 2010Kang-min Liu
 
Virtual Bolt Workshop - 6 May
Virtual Bolt Workshop - 6 MayVirtual Bolt Workshop - 6 May
Virtual Bolt Workshop - 6 MayPuppet
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.catPablo Godel
 
Virtual Bolt Workshop, 5 May 2020
Virtual Bolt Workshop, 5 May 2020Virtual Bolt Workshop, 5 May 2020
Virtual Bolt Workshop, 5 May 2020Puppet
 
Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...
Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...
Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...Puppet
 
PHP & JavaScript & CSS Coding style
PHP & JavaScript & CSS Coding stylePHP & JavaScript & CSS Coding style
PHP & JavaScript & CSS Coding styleBo-Yi Wu
 
Gearman work queue in php
Gearman work queue in phpGearman work queue in php
Gearman work queue in phpBo-Yi Wu
 
DevOps hackathon Session 2: Basics of Chef
DevOps hackathon Session 2: Basics of ChefDevOps hackathon Session 2: Basics of Chef
DevOps hackathon Session 2: Basics of ChefAntons Kranga
 
Modulesync- How vox pupuli manages 133 modules, Tim Meusel
Modulesync- How vox pupuli manages 133 modules, Tim MeuselModulesync- How vox pupuli manages 133 modules, Tim Meusel
Modulesync- How vox pupuli manages 133 modules, Tim MeuselPuppet
 
Becoming a Plumber: Building Deployment Pipelines - RevConf
Becoming a Plumber: Building Deployment Pipelines - RevConfBecoming a Plumber: Building Deployment Pipelines - RevConf
Becoming a Plumber: Building Deployment Pipelines - RevConfDaniel Barker
 
Let the contribution begin
Let the contribution beginLet the contribution begin
Let the contribution beginSeongJae Park
 
Let the contribution begin (EST futures)
Let the contribution begin  (EST futures)Let the contribution begin  (EST futures)
Let the contribution begin (EST futures)SeongJae Park
 
今すぐ始めるCloud Foundry #hackt #hackt_k
今すぐ始めるCloud Foundry #hackt #hackt_k今すぐ始めるCloud Foundry #hackt #hackt_k
今すぐ始めるCloud Foundry #hackt #hackt_kToshiaki Maki
 

Tendances (20)

Frontend Performance: De débutant à Expert à Fou Furieux
Frontend Performance: De débutant à Expert à Fou FurieuxFrontend Performance: De débutant à Expert à Fou Furieux
Frontend Performance: De débutant à Expert à Fou Furieux
 
Frontend Performance: Beginner to Expert to Crazy Person
Frontend Performance: Beginner to Expert to Crazy PersonFrontend Performance: Beginner to Expert to Crazy Person
Frontend Performance: Beginner to Expert to Crazy Person
 
PyCon Korea - Real World Graphene
PyCon Korea - Real World GraphenePyCon Korea - Real World Graphene
PyCon Korea - Real World Graphene
 
Virtual CD4PE Workshop
Virtual CD4PE WorkshopVirtual CD4PE Workshop
Virtual CD4PE Workshop
 
perlbrew yapcasia 2010
perlbrew yapcasia 2010perlbrew yapcasia 2010
perlbrew yapcasia 2010
 
Virtual Bolt Workshop - 6 May
Virtual Bolt Workshop - 6 MayVirtual Bolt Workshop - 6 May
Virtual Bolt Workshop - 6 May
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Pinto+Stratopan+Love
Pinto+Stratopan+LovePinto+Stratopan+Love
Pinto+Stratopan+Love
 
Virtual Bolt Workshop, 5 May 2020
Virtual Bolt Workshop, 5 May 2020Virtual Bolt Workshop, 5 May 2020
Virtual Bolt Workshop, 5 May 2020
 
Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...
Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...
Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...
 
PHP & JavaScript & CSS Coding style
PHP & JavaScript & CSS Coding stylePHP & JavaScript & CSS Coding style
PHP & JavaScript & CSS Coding style
 
Perlbrew
PerlbrewPerlbrew
Perlbrew
 
Gearman work queue in php
Gearman work queue in phpGearman work queue in php
Gearman work queue in php
 
DevOps hackathon Session 2: Basics of Chef
DevOps hackathon Session 2: Basics of ChefDevOps hackathon Session 2: Basics of Chef
DevOps hackathon Session 2: Basics of Chef
 
Modulesync- How vox pupuli manages 133 modules, Tim Meusel
Modulesync- How vox pupuli manages 133 modules, Tim MeuselModulesync- How vox pupuli manages 133 modules, Tim Meusel
Modulesync- How vox pupuli manages 133 modules, Tim Meusel
 
Becoming a Plumber: Building Deployment Pipelines - RevConf
Becoming a Plumber: Building Deployment Pipelines - RevConfBecoming a Plumber: Building Deployment Pipelines - RevConf
Becoming a Plumber: Building Deployment Pipelines - RevConf
 
Let the contribution begin
Let the contribution beginLet the contribution begin
Let the contribution begin
 
Let the contribution begin (EST futures)
Let the contribution begin  (EST futures)Let the contribution begin  (EST futures)
Let the contribution begin (EST futures)
 
Perl in Teh Cloud
Perl in Teh CloudPerl in Teh Cloud
Perl in Teh Cloud
 
今すぐ始めるCloud Foundry #hackt #hackt_k
今すぐ始めるCloud Foundry #hackt #hackt_k今すぐ始めるCloud Foundry #hackt #hackt_k
今すぐ始めるCloud Foundry #hackt #hackt_k
 

En vedette

Groovy 1.8 et 2.0 au BreizhC@mp 2012
Groovy 1.8 et 2.0 au BreizhC@mp 2012Groovy 1.8 et 2.0 au BreizhC@mp 2012
Groovy 1.8 et 2.0 au BreizhC@mp 2012Guillaume Laforge
 
Groovy Update, new in 1.8 and beyond - Guillaume Laforge - Devoxx 2011
Groovy Update, new in 1.8 and beyond - Guillaume Laforge - Devoxx 2011Groovy Update, new in 1.8 and beyond - Guillaume Laforge - Devoxx 2011
Groovy Update, new in 1.8 and beyond - Guillaume Laforge - Devoxx 2011Guillaume Laforge
 
Groovy Update - Guillaume Laforge - Greach 2011
Groovy Update - Guillaume Laforge - Greach 2011Groovy Update - Guillaume Laforge - Greach 2011
Groovy Update - Guillaume Laforge - Greach 2011Guillaume Laforge
 
Local Social Summit Report No 1 & Trends for 2012
Local Social Summit Report No 1 & Trends for 2012Local Social Summit Report No 1 & Trends for 2012
Local Social Summit Report No 1 & Trends for 2012Local Social Summit
 
Local Social Summit Report No 2 & Trends for 2012
Local Social Summit Report No 2 & Trends for 2012Local Social Summit Report No 2 & Trends for 2012
Local Social Summit Report No 2 & Trends for 2012Local Social Summit
 
Media Kit IMS Social Twitter Perú 2014
Media Kit IMS Social Twitter Perú 2014Media Kit IMS Social Twitter Perú 2014
Media Kit IMS Social Twitter Perú 2014Johiss Lavini
 
05 朱近之 ibm云计算解决方案概览 0611
05 朱近之 ibm云计算解决方案概览 061105 朱近之 ibm云计算解决方案概览 0611
05 朱近之 ibm云计算解决方案概览 0611ikewu83
 
LSS'11: Charting Collections Of Connections In Social Media
LSS'11: Charting Collections Of Connections In Social MediaLSS'11: Charting Collections Of Connections In Social Media
LSS'11: Charting Collections Of Connections In Social MediaLocal Social Summit
 
Groovy 2.0 update - Cloud Foundry Open Tour Moscow - Guillaume Laforge
Groovy 2.0 update - Cloud Foundry Open Tour Moscow - Guillaume LaforgeGroovy 2.0 update - Cloud Foundry Open Tour Moscow - Guillaume Laforge
Groovy 2.0 update - Cloud Foundry Open Tour Moscow - Guillaume LaforgeGuillaume Laforge
 
Lift off with Groovy 2 at JavaOne 2013
Lift off with Groovy 2 at JavaOne 2013Lift off with Groovy 2 at JavaOne 2013
Lift off with Groovy 2 at JavaOne 2013Guillaume Laforge
 
The Future of Indoor Mapping - Nokia / Here
The Future of Indoor Mapping - Nokia / HereThe Future of Indoor Mapping - Nokia / Here
The Future of Indoor Mapping - Nokia / HereLocal Social Summit
 

En vedette (12)

JavaOne 2012 Groovy update
JavaOne 2012 Groovy updateJavaOne 2012 Groovy update
JavaOne 2012 Groovy update
 
Groovy 1.8 et 2.0 au BreizhC@mp 2012
Groovy 1.8 et 2.0 au BreizhC@mp 2012Groovy 1.8 et 2.0 au BreizhC@mp 2012
Groovy 1.8 et 2.0 au BreizhC@mp 2012
 
Groovy Update, new in 1.8 and beyond - Guillaume Laforge - Devoxx 2011
Groovy Update, new in 1.8 and beyond - Guillaume Laforge - Devoxx 2011Groovy Update, new in 1.8 and beyond - Guillaume Laforge - Devoxx 2011
Groovy Update, new in 1.8 and beyond - Guillaume Laforge - Devoxx 2011
 
Groovy Update - Guillaume Laforge - Greach 2011
Groovy Update - Guillaume Laforge - Greach 2011Groovy Update - Guillaume Laforge - Greach 2011
Groovy Update - Guillaume Laforge - Greach 2011
 
Local Social Summit Report No 1 & Trends for 2012
Local Social Summit Report No 1 & Trends for 2012Local Social Summit Report No 1 & Trends for 2012
Local Social Summit Report No 1 & Trends for 2012
 
Local Social Summit Report No 2 & Trends for 2012
Local Social Summit Report No 2 & Trends for 2012Local Social Summit Report No 2 & Trends for 2012
Local Social Summit Report No 2 & Trends for 2012
 
Media Kit IMS Social Twitter Perú 2014
Media Kit IMS Social Twitter Perú 2014Media Kit IMS Social Twitter Perú 2014
Media Kit IMS Social Twitter Perú 2014
 
05 朱近之 ibm云计算解决方案概览 0611
05 朱近之 ibm云计算解决方案概览 061105 朱近之 ibm云计算解决方案概览 0611
05 朱近之 ibm云计算解决方案概览 0611
 
LSS'11: Charting Collections Of Connections In Social Media
LSS'11: Charting Collections Of Connections In Social MediaLSS'11: Charting Collections Of Connections In Social Media
LSS'11: Charting Collections Of Connections In Social Media
 
Groovy 2.0 update - Cloud Foundry Open Tour Moscow - Guillaume Laforge
Groovy 2.0 update - Cloud Foundry Open Tour Moscow - Guillaume LaforgeGroovy 2.0 update - Cloud Foundry Open Tour Moscow - Guillaume Laforge
Groovy 2.0 update - Cloud Foundry Open Tour Moscow - Guillaume Laforge
 
Lift off with Groovy 2 at JavaOne 2013
Lift off with Groovy 2 at JavaOne 2013Lift off with Groovy 2 at JavaOne 2013
Lift off with Groovy 2 at JavaOne 2013
 
The Future of Indoor Mapping - Nokia / Here
The Future of Indoor Mapping - Nokia / HereThe Future of Indoor Mapping - Nokia / Here
The Future of Indoor Mapping - Nokia / Here
 

Similaire à Gaelyk update - Guillaume Laforge - SpringOne2GX 2011

Gaelyk - JFokus 2011 - Guillaume Laforge
Gaelyk - JFokus 2011 - Guillaume LaforgeGaelyk - JFokus 2011 - Guillaume Laforge
Gaelyk - JFokus 2011 - Guillaume LaforgeGuillaume Laforge
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGuillaume Laforge
 
Rapid Application Development on Google App Engine for Java
Rapid Application Development on Google App Engine for JavaRapid Application Development on Google App Engine for Java
Rapid Application Development on Google App Engine for JavaKunal Dabir
 
Groovy on Google App Engine with Gaelyk
Groovy on Google App Engine with GaelykGroovy on Google App Engine with Gaelyk
Groovy on Google App Engine with GaelykKevin H.A. Tan
 
Google App Engine for PHP
Google App Engine for PHP Google App Engine for PHP
Google App Engine for PHP Eric Johnson
 
Cloud Platforms for Java
Cloud Platforms for JavaCloud Platforms for Java
Cloud Platforms for Java3Pillar Global
 
Google Cloud Platform, Compute Engine, and App Engine
Google Cloud Platform, Compute Engine, and App EngineGoogle Cloud Platform, Compute Engine, and App Engine
Google Cloud Platform, Compute Engine, and App EngineCsaba Toth
 
Infinite Scale - Introduction to Google App Engine
Infinite Scale - Introduction to Google App EngineInfinite Scale - Introduction to Google App Engine
Infinite Scale - Introduction to Google App EngineMarian Borca
 
Go on GAE (Go Israel Meetup)
Go on GAE (Go Israel Meetup)Go on GAE (Go Israel Meetup)
Go on GAE (Go Israel Meetup)Or Hiltch
 
Gaelyk - Paris GGUG 2011 - Guillaume Laforge
Gaelyk - Paris GGUG 2011 - Guillaume LaforgeGaelyk - Paris GGUG 2011 - Guillaume Laforge
Gaelyk - Paris GGUG 2011 - Guillaume LaforgeGuillaume Laforge
 
Power up Magnolia CMS with OpenShift
Power up Magnolia CMS with OpenShiftPower up Magnolia CMS with OpenShift
Power up Magnolia CMS with OpenShiftShekhar Gulati
 
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...Igalia
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for JavaLars Vogel
 
Gaelyk - Groovy Grails eXchange 2010 - Guillaume Laforge
Gaelyk - Groovy Grails eXchange 2010 - Guillaume LaforgeGaelyk - Groovy Grails eXchange 2010 - Guillaume Laforge
Gaelyk - Groovy Grails eXchange 2010 - Guillaume LaforgeGuillaume Laforge
 
Building OpenStreetMap.org, SOTM US 2015
Building OpenStreetMap.org, SOTM US 2015Building OpenStreetMap.org, SOTM US 2015
Building OpenStreetMap.org, SOTM US 2015Tom Hughes
 
Introduction to PhoneGap
Introduction to PhoneGapIntroduction to PhoneGap
Introduction to PhoneGapRamesh Nair
 
Lessons Learned from Building a REST API on Google App Engine
Lessons Learned from Building a REST API on Google App EngineLessons Learned from Building a REST API on Google App Engine
Lessons Learned from Building a REST API on Google App Engineasync_io
 
Appscale at CLOUDCOMP '09
Appscale at CLOUDCOMP '09Appscale at CLOUDCOMP '09
Appscale at CLOUDCOMP '09Chris Bunch
 
Google app-engine-cloudcamplagos2011
Google app-engine-cloudcamplagos2011Google app-engine-cloudcamplagos2011
Google app-engine-cloudcamplagos2011Opevel
 

Similaire à Gaelyk update - Guillaume Laforge - SpringOne2GX 2011 (20)

Gaelyk - JFokus 2011 - Guillaume Laforge
Gaelyk - JFokus 2011 - Guillaume LaforgeGaelyk - JFokus 2011 - Guillaume Laforge
Gaelyk - JFokus 2011 - Guillaume Laforge
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and Gaelyk
 
Rapid Application Development on Google App Engine for Java
Rapid Application Development on Google App Engine for JavaRapid Application Development on Google App Engine for Java
Rapid Application Development on Google App Engine for Java
 
Groovy on Google App Engine with Gaelyk
Groovy on Google App Engine with GaelykGroovy on Google App Engine with Gaelyk
Groovy on Google App Engine with Gaelyk
 
Google App Engine for PHP
Google App Engine for PHP Google App Engine for PHP
Google App Engine for PHP
 
Cloud Platforms for Java
Cloud Platforms for JavaCloud Platforms for Java
Cloud Platforms for Java
 
Google Cloud Platform, Compute Engine, and App Engine
Google Cloud Platform, Compute Engine, and App EngineGoogle Cloud Platform, Compute Engine, and App Engine
Google Cloud Platform, Compute Engine, and App Engine
 
Building JavaScript
Building JavaScriptBuilding JavaScript
Building JavaScript
 
Infinite Scale - Introduction to Google App Engine
Infinite Scale - Introduction to Google App EngineInfinite Scale - Introduction to Google App Engine
Infinite Scale - Introduction to Google App Engine
 
Go on GAE (Go Israel Meetup)
Go on GAE (Go Israel Meetup)Go on GAE (Go Israel Meetup)
Go on GAE (Go Israel Meetup)
 
Gaelyk - Paris GGUG 2011 - Guillaume Laforge
Gaelyk - Paris GGUG 2011 - Guillaume LaforgeGaelyk - Paris GGUG 2011 - Guillaume Laforge
Gaelyk - Paris GGUG 2011 - Guillaume Laforge
 
Power up Magnolia CMS with OpenShift
Power up Magnolia CMS with OpenShiftPower up Magnolia CMS with OpenShift
Power up Magnolia CMS with OpenShift
 
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for Java
 
Gaelyk - Groovy Grails eXchange 2010 - Guillaume Laforge
Gaelyk - Groovy Grails eXchange 2010 - Guillaume LaforgeGaelyk - Groovy Grails eXchange 2010 - Guillaume Laforge
Gaelyk - Groovy Grails eXchange 2010 - Guillaume Laforge
 
Building OpenStreetMap.org, SOTM US 2015
Building OpenStreetMap.org, SOTM US 2015Building OpenStreetMap.org, SOTM US 2015
Building OpenStreetMap.org, SOTM US 2015
 
Introduction to PhoneGap
Introduction to PhoneGapIntroduction to PhoneGap
Introduction to PhoneGap
 
Lessons Learned from Building a REST API on Google App Engine
Lessons Learned from Building a REST API on Google App EngineLessons Learned from Building a REST API on Google App Engine
Lessons Learned from Building a REST API on Google App Engine
 
Appscale at CLOUDCOMP '09
Appscale at CLOUDCOMP '09Appscale at CLOUDCOMP '09
Appscale at CLOUDCOMP '09
 
Google app-engine-cloudcamplagos2011
Google app-engine-cloudcamplagos2011Google app-engine-cloudcamplagos2011
Google app-engine-cloudcamplagos2011
 

Plus de Guillaume Laforge

Groovy workshop à Mix-IT 2013
Groovy workshop à Mix-IT 2013Groovy workshop à Mix-IT 2013
Groovy workshop à Mix-IT 2013Guillaume Laforge
 
Les nouveautés de Groovy 2 -- Mix-IT 2013
Les nouveautés de Groovy 2 -- Mix-IT 2013Les nouveautés de Groovy 2 -- Mix-IT 2013
Les nouveautés de Groovy 2 -- Mix-IT 2013Guillaume Laforge
 
Groovy 2.0 update at Devoxx 2012
Groovy 2.0 update at Devoxx 2012Groovy 2.0 update at Devoxx 2012
Groovy 2.0 update at Devoxx 2012Guillaume Laforge
 
Groovy Domain Specific Languages - SpringOne2GX 2012
Groovy Domain Specific Languages - SpringOne2GX 2012Groovy Domain Specific Languages - SpringOne2GX 2012
Groovy Domain Specific Languages - SpringOne2GX 2012Guillaume Laforge
 
Groovy update at SpringOne2GX 2012
Groovy update at SpringOne2GX 2012Groovy update at SpringOne2GX 2012
Groovy update at SpringOne2GX 2012Guillaume Laforge
 
Going to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific LanguagesGoing to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific LanguagesGuillaume Laforge
 
Groovy 2.0 - Devoxx France 2012
Groovy 2.0 - Devoxx France 2012Groovy 2.0 - Devoxx France 2012
Groovy 2.0 - Devoxx France 2012Guillaume Laforge
 
GPars et PrettyTime - Paris JUG 2011 - Guillaume Laforge
GPars et PrettyTime - Paris JUG 2011 - Guillaume LaforgeGPars et PrettyTime - Paris JUG 2011 - Guillaume Laforge
GPars et PrettyTime - Paris JUG 2011 - Guillaume LaforgeGuillaume Laforge
 
Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...
Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...
Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...Guillaume Laforge
 
Cloud foundry intro with groovy
Cloud foundry intro with groovyCloud foundry intro with groovy
Cloud foundry intro with groovyGuillaume Laforge
 
Groovy update - S2GForum London 2011 - Guillaume Laforge
Groovy update - S2GForum London 2011 - Guillaume LaforgeGroovy update - S2GForum London 2011 - Guillaume Laforge
Groovy update - S2GForum London 2011 - Guillaume LaforgeGuillaume Laforge
 
Groovy DSLs - S2GForum London 2011 - Guillaume Laforge
Groovy DSLs - S2GForum London 2011 - Guillaume LaforgeGroovy DSLs - S2GForum London 2011 - Guillaume Laforge
Groovy DSLs - S2GForum London 2011 - Guillaume LaforgeGuillaume Laforge
 
Gaelyk - Guillaume Laforge - GR8Conf Europe 2011
Gaelyk - Guillaume Laforge - GR8Conf Europe 2011Gaelyk - Guillaume Laforge - GR8Conf Europe 2011
Gaelyk - Guillaume Laforge - GR8Conf Europe 2011Guillaume Laforge
 
Groovy 1.8 update - Guillaume Laforge - GR8Conf Europe 2011
Groovy 1.8 update - Guillaume Laforge - GR8Conf Europe 2011Groovy 1.8 update - Guillaume Laforge - GR8Conf Europe 2011
Groovy 1.8 update - Guillaume Laforge - GR8Conf Europe 2011Guillaume Laforge
 
Groovy Ecosystem - JFokus 2011 - Guillaume Laforge
Groovy Ecosystem - JFokus 2011 - Guillaume LaforgeGroovy Ecosystem - JFokus 2011 - Guillaume Laforge
Groovy Ecosystem - JFokus 2011 - Guillaume LaforgeGuillaume Laforge
 
Groovy and Gaelyk - Lausanne JUG 2011 - Guillaume Laforge
Groovy and Gaelyk - Lausanne JUG 2011 - Guillaume LaforgeGroovy and Gaelyk - Lausanne JUG 2011 - Guillaume Laforge
Groovy and Gaelyk - Lausanne JUG 2011 - Guillaume LaforgeGuillaume Laforge
 

Plus de Guillaume Laforge (19)

Groovy workshop à Mix-IT 2013
Groovy workshop à Mix-IT 2013Groovy workshop à Mix-IT 2013
Groovy workshop à Mix-IT 2013
 
Les nouveautés de Groovy 2 -- Mix-IT 2013
Les nouveautés de Groovy 2 -- Mix-IT 2013Les nouveautés de Groovy 2 -- Mix-IT 2013
Les nouveautés de Groovy 2 -- Mix-IT 2013
 
Groovy 2 and beyond
Groovy 2 and beyondGroovy 2 and beyond
Groovy 2 and beyond
 
Groovy 2.0 update at Devoxx 2012
Groovy 2.0 update at Devoxx 2012Groovy 2.0 update at Devoxx 2012
Groovy 2.0 update at Devoxx 2012
 
Groovy 2.0 webinar
Groovy 2.0 webinarGroovy 2.0 webinar
Groovy 2.0 webinar
 
Groovy Domain Specific Languages - SpringOne2GX 2012
Groovy Domain Specific Languages - SpringOne2GX 2012Groovy Domain Specific Languages - SpringOne2GX 2012
Groovy Domain Specific Languages - SpringOne2GX 2012
 
Groovy update at SpringOne2GX 2012
Groovy update at SpringOne2GX 2012Groovy update at SpringOne2GX 2012
Groovy update at SpringOne2GX 2012
 
Going to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific LanguagesGoing to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific Languages
 
Groovy 2.0 - Devoxx France 2012
Groovy 2.0 - Devoxx France 2012Groovy 2.0 - Devoxx France 2012
Groovy 2.0 - Devoxx France 2012
 
Whats new in Groovy 2.0?
Whats new in Groovy 2.0?Whats new in Groovy 2.0?
Whats new in Groovy 2.0?
 
GPars et PrettyTime - Paris JUG 2011 - Guillaume Laforge
GPars et PrettyTime - Paris JUG 2011 - Guillaume LaforgeGPars et PrettyTime - Paris JUG 2011 - Guillaume Laforge
GPars et PrettyTime - Paris JUG 2011 - Guillaume Laforge
 
Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...
Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...
Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...
 
Cloud foundry intro with groovy
Cloud foundry intro with groovyCloud foundry intro with groovy
Cloud foundry intro with groovy
 
Groovy update - S2GForum London 2011 - Guillaume Laforge
Groovy update - S2GForum London 2011 - Guillaume LaforgeGroovy update - S2GForum London 2011 - Guillaume Laforge
Groovy update - S2GForum London 2011 - Guillaume Laforge
 
Groovy DSLs - S2GForum London 2011 - Guillaume Laforge
Groovy DSLs - S2GForum London 2011 - Guillaume LaforgeGroovy DSLs - S2GForum London 2011 - Guillaume Laforge
Groovy DSLs - S2GForum London 2011 - Guillaume Laforge
 
Gaelyk - Guillaume Laforge - GR8Conf Europe 2011
Gaelyk - Guillaume Laforge - GR8Conf Europe 2011Gaelyk - Guillaume Laforge - GR8Conf Europe 2011
Gaelyk - Guillaume Laforge - GR8Conf Europe 2011
 
Groovy 1.8 update - Guillaume Laforge - GR8Conf Europe 2011
Groovy 1.8 update - Guillaume Laforge - GR8Conf Europe 2011Groovy 1.8 update - Guillaume Laforge - GR8Conf Europe 2011
Groovy 1.8 update - Guillaume Laforge - GR8Conf Europe 2011
 
Groovy Ecosystem - JFokus 2011 - Guillaume Laforge
Groovy Ecosystem - JFokus 2011 - Guillaume LaforgeGroovy Ecosystem - JFokus 2011 - Guillaume Laforge
Groovy Ecosystem - JFokus 2011 - Guillaume Laforge
 
Groovy and Gaelyk - Lausanne JUG 2011 - Guillaume Laforge
Groovy and Gaelyk - Lausanne JUG 2011 - Guillaume LaforgeGroovy and Gaelyk - Lausanne JUG 2011 - Guillaume Laforge
Groovy and Gaelyk - Lausanne JUG 2011 - Guillaume Laforge
 

Dernier

Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 

Dernier (20)

Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 

Gaelyk update - Guillaume Laforge - SpringOne2GX 2011

  • 1. Gaelyk: Groovy Coding to the Cloud Guillaume Laforge Groovy Project Manager SpringSource, a division of VMware Twitter: @glaforge Blog: http://glaforge.appspot.com © 2011 SpringOne 2GX 2011. All rights reserved. Do not distribute without permission.
  • 2. Guillaume Laforge • Groovy Project Manager at VMware • Initiator of the Grails framework • Creator of the Gaelyk toolkit • Co-author of Groovy in Action • Speaking worldwide w/ a French accent • Follow me on... • My blog: http://glaforge.appspot.com • Twitter: @glaforge • Google+: http://gplus.to/glaforge 2 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 3. Guillaume Laforge • Groovy Project Manager at VMware • Initiator of the Grails framework • Creator of the Gaelyk toolkit • Co-author of Groovy in Action • Speaking worldwide w/ a French accent • Follow me on... • My blog: http://glaforge.appspot.com • Twitter: @glaforge • Google+: http://gplus.to/glaforge 2 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 4. Introduction to Google App Engine © 2011 SpringOne 2GX 2011. All rights reserved. Do not distribute without permission.
  • 5. IaaS, PaaS, SaaS • Software as a Service – Gmail, SalesForce.com SaaS • Platform as a Service – Google App Engine PaaS – -CloudFoundry • Infrastructure as a Service IaaS – Amazon EC2 4 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 6. IaaS, PaaS, SaaS • Software as a Service – Gmail, SalesForce.com SaaS • Platform as a Service – Google App Engine PaaS – -CloudFoundry • Infrastructure as a Service IaaS – Amazon EC2 4 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 7. IaaS, PaaS, SaaS • Software as a Service – Gmail, SalesForce.com SaaS • Platform as a Service – Google App Engine PaaS – -CloudFoundry • Infrastructure as a Service IaaS – Amazon EC2 4 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 8. Google App Engine • Google’s PaaS solution – Run your app on Google’s infrastructure • Initially just Python supported • Java support added too – Sandboxed JVM – Jetty servlet container • Several JVM-compatible language supported 5 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 9. Key aspects • You can use most of your usual web frameworks for developping apps on App Engine Java – A WAR file, basically! (an exploded war actually) – Uploading to the cloud by sending deltas of changes • No OS image, or software to install – Unlike with Amazon EC2 • All the scaling aspects are handled for you – Database / session replication, load balancing... • There are quotas, but you need a medium traffic application to start being charged 6 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 10. Some of the available services • Memcache – JCache implementation • XMPP – Save on CPU and datastore – Send / receive Jabber messages (GTalk) • URL Fetch – Access remote resources • User – HttpUrlConnection – Use Google’s user/ authentication system • Mail – OAuth support – Support both incoming and • Cron & Task queues outgoing emails – Schedule tasks at regular • Images intervals – Resize, crop, rotate... – Queue units of work 7 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 11. Limitations • Time and size limits – 60 second requests — was 30s – 60 second / 5MB URLFetch — was 10s / 1MB – 10K files / 32MB each — was 3K files / 10MB each • Forbidden to – write on the file system – create threads – use raw sockets – issue system calls – use IO / Swing / etc. directly 8 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 12. Quotas & Billing 9 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 13.
  • 15.
  • 17.
  • 19.
  • 20. Paid tier w/ free quota
  • 21.
  • 23.
  • 24.
  • 26.
  • 28. The datastore... • Distributed key / value store – Based on Google’s «BigTable» – Schema-less approach • Supporting – Transactions and partitioning – Hierarchies through entity groups • Data access APIs – JPA and JDO • but adds a big request load time factor 13 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 29. ...and its «limitations» • You’re not using SQL – No joins – No database constraints – No aggregation functions (count, avg...) – But there’s a preview for a «Cloud SQL» • Only filter on one column for inequality in queries • Transactions only available in entity groups – cross group transactions are coming though • You can only update an entity once in a transaction 14 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 31. Now... letʼs dive into Gaelyk! © 2011 SpringOne 2GX 2011. All rights reserved. Do not distribute without permission.
  • 34. • Gaelyk is a lightweight Groovy toolkit on top of the Google App Engine Java SDK • Gaelyk builds on Groovy’s servlet support – Groovlets: Groovy scripts instead of raw servlets! – Groovy templates: JSP-like template engine – Both allow for a clean separation of views and logic • Gaelyk provides several enhancements around the GAE Java SDK to make life easier, thanks to Groovy’s dynamic nature 18 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 35. Why Groovy? • Groovy is a dynamic language for the JVM – very flexible, malleable, expressive and concise syntax – easy to learn for Java developers • deriving from the Java 5 grammar – provides powerful APIs to simplify the life of developers • possibility to dynamically enrich existing APIs – support for Groovlets and its own template engine 19 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 36. First steps... • Go to http://gaelyk.appspot.com • Download the template project • Put your first Groovlet in /WEB-INF/groovy • And your templates in /WEB-INF/pages • And you’re ready to go! • Launch dev_appserver.sh • Go to http://localhost:8080/
  • 37. The web.xml "> <web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5 <listener> /servlet-class> <listener-class>groovyx.gaelyk.GaelykServletContextListener< </listener> <servlet> <servlet-name>GroovletServlet</servlet-name> <servlet-class>groovyx.gaelyk.GaelykServlet</servlet-class> </servlet> <servlet> <servlet-name>TemplateServlet</servlet-name> -class> <servlet-class>groovyx.gaelyk.GaelykTemplateServlet</servlet </servlet> <servlet-mapping> <servlet-name>GroovletServlet</servlet-name> <url-pattern>*.groovy</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>TemplateServlet</servlet-name> <url-pattern>*.gtpl</url-pattern> </servlet-mapping> </web-app> 21 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 38. MVC: Groovlets and templates Groovlets Templates (controllers) (views) Entities (domain) @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 39. A groovlet • Instead of writing full-blown servlets, just write Groovy scripts (aka Groovlets) def numbers = [1, 2, 3, 4] def now = new Date() html.html { body { numbers.each { number -> p number } p now } } 23 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 40. A groovlet • Instead of writing full-blown servlets, just write Groovy scripts (aka Groovlets) def numbers = [1, 2, 3, 4] def now = new Date() html.html { body { numbers.each { number -> p number } p now } di ng oa } -r el to Au 23 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 41. A template <html> <body> <p><% def message = "Hello World!" print message %> </p> <p><%= message %></p> <p>${message}</p> <ul> <% 3.times { %> <li>${message}</li> <% } %> </ul> </body> </html> 24 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 42. A template <html> <body> <p><% def message = "Hello World!" print message %> </p> <p><%= message %></p> <p>${message}</p> <ul> <% 3.times { %> <li>${message}</li> <% } %> di ng </ul> el oa </body> to -r Au </html> 24 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 43. Shortcuts • Google services – namespace – datastore, blobstore • Variables available – backends, lifecycle – request / response – memcache – context / application – capabilities – sessions – images – params / headers – urlFetch – out / sout / html – mail – localMode / app.* – userService / user – defaultQueue / queues • Methods available – xmpp – include / forward / redirect 25 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 45. Sending emails with Gaelyk mail.send to: 'to@gmail.com', from: 'other@gmail.com', subject: 'Hello World', htmlBody: '<bold>Hello</bold>' 27 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 46. ...compared to Java Properties props = new Properties(); , null); Sessio n session = Session.getDefaultInstance(props try { Message msg = new MimeMessage(session); om"));     msg .setFrom(new InternetAddress("other@gmail.c O,     msg.addRecipient(Message.RecipientType.T o@example.com"));                      new InternetAddress("t     msg.setSubject("Hello World");     msg.setText("<bold>Hello</bold>");     Transport.send(msg); } catch (AddressException e) {} } catch (MessagingException e) {} 28 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 47. Unfair comparision? 29 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 48. Unfair comparision? 29 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 49. Unfair comparision? 29 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 50. Accessing the datastore • Direct interaction with the low-level datastore API Entity entity = new Entity("person")   map // subscript notation, like when accessing a entity['name'] = "Guillaume Laforge"   // normal property access notation entity.age = 32 entity.save() // asyncSave() entity.delete() // asyncDelete() datastore.withTransaction { // do stuff with your entities // within the transaction } // use the asynchronous datastore service datastore.async.put(entity) 30 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 51. Querying the datastore • Before... (Java-style) import com.google.appengine.api.datastore.* der.* import static com.google.appengine.api.datastore.FetchOptions.Buil   // query the scripts stored in the datastore def query = new Query("savedscript")   // sort results by descending order of the creation date query.addSort("dateCreated", Query.SortDirection.DESCENDING)   author // filters the entities so as to return only scripts by a certain r) query.addFilter("author", Query.FilterOperator.EQUAL, params.autho   PreparedQuery preparedQuery = datastore.prepare(query)   // return only the first 10 results def entities = preparedQuery.asList( withLimit(10) ) 31 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 52. Querying the datastore... Groovy style! • After... def entities = datastore.query { select all from savedscript sort desc by dateCreated where author == params.author limit 10 } • SQL-like query DSL – select: ‘all’, ‘count’, ‘single’, ‘keys’ – from: entityName as SomeClass 32 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 53. @GaelykBinding • The various services and variables are injected in the binding of Groovlets and Templates – but were not accessible from plain classes • The transformation @GaelykBinding injects those variables import
groovyx.gaelyk.GaelykBindings 
 //
annotate
your
class
with
the
transformation @GaelykBindings class
WeblogService
{ 



def
numberOfComments(post)
{ 







//
the
datastore
service
is
available 







datastore.execute
{ 











select
count
from
comments
where
postId
==
post.id 







} 



} } 33 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 54. URL Routing system • You can have friendly URL mappings with the URL routing system all "/aboutus", redirect: "/blog/2008/10/20/about-us" all "/blog/@year/@month/@day/@title", y@title=@title" for ward: "/blog.groovy?year=@year&month=@month@day=@da get "/blog/@year/@month/@day", @day" forward: "/blog.groovy?year=@year&month=@month@day= get "/book/isbn/@isbn", forward: "/book.groovy?isbn=@isbn", validate: { isbn ==~ /d{9}(d|X)/ } 34 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 55. URL Routing system 2.5"> <web-app xmlns="http://java.sun.com/xml/ns/javaee" version=" ... <filter> <filter-name>RoutesFilter</filter-name> ss> <filter-class>groovyx.gaelyk.routes.RoutesFilter</filter-cla </filter> <filter-mapping> <servlet-name>RoutesFilter</servlet-name> <url-pattern>/*</url-pattern> </filter-mapping> ... </web-app> 35 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 56. URL Routing system • You can also define caching times get "/aboutus", cache: 24.hours, forward: "/aboutus.gtpl" get "/breaking-news", cache: 1.minute, forward: "/news.groovy?last=10" – Nice for GAE’s infamous «loading requests» • less critical since GAE SDK 1.4 – warmup requests 36 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 57. URL Routing system • Special routes for specifying – incoming emails – jabber chat messages – jabber presence and subscription messages email to: "/incomingMail.groovy" jabber to: "/incomingXmpp.groovy" // synonym: jabber chat, to: "..." jabber presence, to: "/subs.groovy" jabber subscrpition, to: "/subs.groovy" 37 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 58. URL Routing system • Namespace awareness: nice for multitenancy • Capability awareness: for graceful degradation // @cust customer variable could be « acme » post "/@cust/update", forward: "/update.groovy", namespace: { "ns-$cust" } es status // different destinations depending on the GAE servic get "/speakers", forward { to "/speakers.groovy" // default destination // when the datastore is not available to "/unavailable.gtpl" on DATASTORE not ENABLED // show some maintenance is upcoming to "/speakers.groovy?maintenance=true" on DATASTORE is SCHEDULED_MAINTENANCE } 38 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 59. Capabilities • Google App Engine allows you to know the status and availability of the various services – DATASTORE, DATESTORE_WRITE, MEMCACHE... – ENABLED, DISABLED, UNKNOWN, SCHEDULED_MAINTENANCE – is() and not() methods if (capabilities[DATASTORE_WRITE].is(ENABLED)) { // write some content in the datastore } else { // otherwise, redirect to some maintenance page } 39 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 60. Task queue API // access a configured queue using the subscript notation queues['dailyEmailQueue']   // or using the property access notation queues.dailyEmailQueue   // you can also access the default queue with: queues.default defaultQueue // add a task to the queue queue << [ countdownMillis: 1000, url: "/task/dailyEmail", taskName: "sendDailyEmailNewsletter", method: 'PUT', params: [date: '20090914'], payload: content ] 40 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 61. Jabber / XMPP support (1/3) • Sending instant messages String recipient = "someone@gmail.com"   // check if the user is online if (xmpp.getPresence(recipient).isAvailable()) { // send the message def status = xmpp.send to: recipient, body: "Hello, how are you?"   // checks the message was successfully // delivered to all the recipients assert status.isSuccessful() } 41 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 62. Jabber / XMPP support (2/3) • Sending instant messages with an XML payload String recipient = "service@gmail.com"   // check if the service is online if (xmpp.getPresence(recipient).isAvailable()) { // send the message def status = xmpp.send to: recipient, xml: { customers { customer(id: 1) { name 'Google' } } }   // checks the message was successfully delivered to the service assert status.isSuccessful() } 42 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 63. Jabber / XMPP support (2/3) • Sending instant messages with an XML payload String recipient = "service@gmail.com"   // check if the service is online if (xmpp.getPresence(recipient).isAvailable()) { // send the message def status = xmpp.send to: recipient, xml: { customers { customer(id: 1) { <customers> name 'Google' <customer id=’1’> } <name>Google</name> } </customer> } </customers>   // checks the message was successfully delivered to the service assert status.isSuccessful() } 42 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 64. Jabber / XMPP support (3/3) • Receving incoming instant messages – Once you’ve configured a route for jabber messages – Add the inbound message service in appengine-web.xml def message = xmpp.parseMessage(request) // get the body of the message message.body // get the sender Jabber ID message.from // get the list of recipients Jabber IDs message.recipients   // if the message is an XML document instead of a raw string message if (message.isXml()) { // get the raw XML message.stanza // get a document parsed with XmlSlurper message.xml } 43 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 65. Memcache service • Map notation access to the cache } class Country implements Serialzable { String name   def countryFr = new Country(name: 'France')   in the cache // use the subscript notation to put a country object // (you can also use non-string keys) memcache['FR'] = countryFr   // check that a key is present in the cache if ('FR' in memcache) { the cache using a key // use the subscript notation to get an entry from def countryFromCache = memcache['FR'] } 44 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 66. Closure memoization • Cache the return values for each dinstinct invocation (for a given arguments set) -> def countEntities = memcache.memoize { String kind datastore.prepare( new Query(kind) ) .countEntities() } // first call def totalPics = countEntityes('photos') // second call, hitting the cache totalPics = countEntityes('photos') 45 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 67. Blobstore enhancements • The blobstore allows to store some large content – images, videos, etc. def blob = ... print blob.filename // contentType, creation, size // output the content of the blob to the response blob.serve response // read the content of the blob blob.withReader { Reader r -> ... } blob.withStream { InputStream is -> ... } // delete the blob blob.delete() 46 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 68. File service • The file service provides a file-like read/write access over blobs from the blobstore services – programmatic creation of blobs was an issue before def
file
=
files.createNewBlobFile("text/plain",
"hello.txt") //
writing
with
a
writer file.withWriter
{
writer
‐> 



writer
<<
"some
content" } //
writing
binary
content file.withOutputStream
{
stream
‐> 



stream
<<
"some
content".bytes } //
file.withWriter(encoding:
"US‐ASCII") //
file.withWriter(locked:
false,
finalize:
false) 47 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 69. File service • Instead of using the blobstore reading capabilities, you can read from the file service //
read
from
a
buffered
input
stream file.withI nputStream
{
BufferedInputStream
stream
‐> 



//
read
from
the
stream } //
read
from
a
buffered
reader file.withReader{
BufferedReader
reader
‐> 



//
read
from
the
reader } //
locked
and
encoding
params
available
too 48 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 70. Images service • Readable DSL for manipulating images def blobKey = ... def image = blobKey.image.transform { resize 1600, 1200 crop 0.1, 0.1, 0.9, 0.9 horizontal flip // vertical flip too rotate 90 feeling lucky // image corrections } def thumbnail = image.resize(100, 100) 49 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 71. Channel Service • For Comet-style applications def token = channel.createChannel('clientID') channel.send 'clientID', 'Hi!' • Then in the view, in JavaScript... channel = new goog.appengine.Channel(token); socket = channel.open(); socket.onmessage = function(msg) { ... } 50 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 72. Simple plugin system • Gaelyk features a simple plugin system for extending your apps and share commonalities • A plugin lets you – provide additional groovlets and templates – contribute new URL routes – add new categories – define variables in the binding – override existing binding variables – provide any static content – add new libraries – do any initialization 51 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 73. Simple plugin system • A plugin is actually just a zip file! – Basically, just a Gaelyk application, minus... • the Groovy / Gaelyk / GAE JARs • the web.xml and appengine-web.xml descriptors – But with a /WEB-INF/plugins/myplugin.groovy descriptor • A plugin must be referenced in /WEB-INF/plugins.groovy with – install myplugin • shortcut to /WEB-INF/plugins/myplugin.groovy 52 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 74. Simple plugin system • An example plugin descriptor – /WEB-INF/plugins/jsonPlugin.groovy import
net.sf.json.groovy.* 
 //
add
new
variables
in
the
binding binding
{ le jsonLibVersion
=
"2.3"









//
a
simple
string
variab json
=
new
JsonGroovyBuilder()

//
3rd
party
class } 
 //
add
new
routes
with
the
usual
routing
system
format routes
{ get
"/json",
forward:
"/json.groovy" } 
 //
install
a
category
you've
developped categories
jsonlib.JsonlibCategory before
{
req,
resp
‐>
...
}
//
or
after 
 //
any
other
initialization
code
you'd
need 53 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 75. Summary • Google App Engine is an interesting PaaS solution – Deploying Java apps, as easily as you would with PHP – The free tier lets you easily try out the platform – But beware of the limitations and lock-in factor • Gaelyk provides a simplified approach to creating Servlet centric webapps in a productive manner – Leveraging Groovy’s servlet / template support and dynamic capabilities 54 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 76. Not only me... Benjamin Muschko Vladimír Orany Marco Vermeulen Gradle GAE plugin Gradle Gaelyk Spock testing Eclipse plugin integration Gradle Gaelyk plugin TDD Gaelyk Gaelyk datastore template (w/ Spock viewer plugin & Easyb integration) Eclipse DSLD file 55 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 78. CloudFoundry Gaelyk variant 57 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 79. CloudFoundry Gaelyk variant p orw are Va 58 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 80. Thank you! e L aforg pment aume vy Develo Guill Groo m Hea d of g mail.co aforge@ mail: gl glaforge e E @ o /glaforg T witter : http://gplus.t Go ogle+: 59 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge
  • 81. Q&A — Got questions, Really? 60 © 2011 SpringOne 2GX 2011. All rights reserved. Do not distribute without permission.
  • 82. Image credits • Speed limit : http://www.morguefile.com/archive/display/18492 Warehouse : http://www.morguefile.com/archive/display/85628 Check mark: http://www.lnl.infn.it/~epics/WikiDumps/localhost/600px-symbol_ok.svg.png Puzzle: http://www.everystockphoto.com/photo.php?imageId=263521 Light bulb: https://newsline.llnl.gov/retooling/mar/03.28.08_images/lightBulb.png Weight balance: http://www.medicalscale1.com/wp-content/uploads/2010/11/balance-weight-scale2.jpg Clouds http://www.morguefile.com/archive/display/627059 http://www.morguefile.com/archive/display/625552 http://www.morguefile.com/archive/display/629785 Duke ok GAE http://weblogs.java.net/blog/felipegaucho/archive/ae_gwt_java.png Python logo : http://python.org/images/python-logo.gif Gaelic cross with clouds : http://www.morguefile.com/archive/display/37889 Snow foot steps : http://www.flickr.com/photos/robinvanmourik/2875929243/ Sugar : http://www.flickr.com/photos/ayelie/441101223/sizes/l/ Press release: http://www.napleswebdesign.net/wp-content/uploads/2009/06/press_release_11.jpg Steve Jobs http://blogs.lentreprise.com/auto-entrepreneur/wp-content/blogs.dir/233/files/2010/07/Steve_Jobs_WWDC07.jpg Duke Nukem Forever http://img.jeuxvideo.fr/photo/00704014-photo-duke-nukem-forever.jpg 61 @glaforge — http://glaforge.appspot.com — http://gplus.to/glaforge

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n
  84. \n
  85. \n