Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building Applications on Google Cloud Platform

Building Applications on Google Cloud Platform

This deck looks at how to build a mobile application and backend from Scratch on Google Cloud Platform and covers Wix Media Platform. This talk was first delivered at The WebSummit in Dublin 2014

GoogleCloudPlatform

November 11, 2014
Tweet

More Decks by GoogleCloudPlatform

Other Decks in Technology

Transcript

  1. Building Applications
    on Google Cloud Platform

    View full-size slide

  2. Design considerations
    Where to run?
    Where to store?
    How to integrate?
    Alternate design options
    1
    2
    3
    Agenda
    4
    5

    View full-size slide

  3. Design considerations

    View full-size slide

  4. ● Take pictures and share them with
    friends
    ● Comment on your friends’ pictures
    ● Let them know you like them!
    Abelana Photo Sharing

    View full-size slide

  5. Technical features
    ● Android app
    ● Multiple authentication providers
    ● All image formats accepted
    ● Only WEBP served
    ● Fast, scalable, fun

    View full-size slide

  6. Abelana App
    Storage
    Image
    formatter
    Abelana Server
    Abelana architecture

    View full-size slide

  7. Abelana architecture
    Abelana App
    Storage
    Image
    formatter
    Abelana Server

    View full-size slide

  8. Abelana Server Requirements
    ● Autoscale - Ready for success
    ● Rapid development
    ● Zero management
    ● Allows for modular App design Abelana Server

    View full-size slide

  9. Google App Engine
    ● Automatic resource provisioning
    and configuration
    ● Fully Managed Platform & Services
    ● Micro-services Framework
    ● Just bring your application code /
    Dockerfile

    View full-size slide

  10. Factor large Apps into micro-
    services
    Modules within an App:
    ● Can share state
    ● Communicate Securely
    ● Have individual performance
    settings and Versions
    ● Can be written in different
    languages
    ● Can be backed by Compute
    Engine VMs (Managed VMs)
    Module
    Module
    Module
    Version
    Version
    Version
    Version
    VM
    Instance
    Instance
    Version
    Version
    VM
    Instance
    App
    App Engine Modules

    View full-size slide

  11. Abelana App
    Storage
    Image
    formatter
    Abelana Server
    Abelana architecture

    View full-size slide

  12. ● Create, edit, compose, or convert
    bitmap images
    ● Supports multiple image formats
    ● Available as a Library and
    command line tool
    ● Written in C
    ImageMagick
    http://www.imagemagick.org/

    View full-size slide

  13. ● App Engine productivity - on VMs
    ○ More flexible, powerful
    ● Bring your own
    ○ Dependencies
    ○ Runtime (Docker container)
    ● What’s new?
    ○ Load Balancing
    ○ Autoscaling
    ○ Cloud SDK Integration
    ● … in Beta today ()
    App Engine Managed VMs now in Beta

    View full-size slide

  14. Abelana App
    Storage
    Abelana Server
    Abelana architecture
    Image
    formatter

    View full-size slide

  15. Abelana Server Architecture
    Endpoints
    Timeline
    Manager
    Notice
    Abelana
    ImageMagick

    View full-size slide

  16. Abelana architecture
    Abelana App
    Storage
    Image
    formatter
    Abelana Server

    View full-size slide

  17. Storage Requirements
    ● Storage for Image uploads and
    processed Images
    ○ Storage Buckets
    ○ Direct access from Mobile App
    ○ Notification of new Images
    Storage

    View full-size slide

  18. ● Bucket based Object store
    ● Simple HTTP API
    ● Object notifications
    Google Cloud Storage

    View full-size slide

  19. Abelana App
    Storage
    Image
    formatter
    Abelana Server
    Abelana architecture

    View full-size slide

  20. Storage Requirements
    ● Storage for Image uploads and
    processing
    ○ Notification of new Images
    ○ Direct access from Mobile App
    ● Application Level Data: Users,
    Comments, Photos, etc
    ○ Scalable, Managed, Easy to Use
    Storage

    View full-size slide

  21. ● Managed NoSQL Datastore
    ● Native access from App Engine
    ● Built-in redundancy
    ● Autoscale
    Google Cloud Datastore

    View full-size slide

  22. Abelana App
    Storage
    Image
    formatter
    Abelana Server
    Abelana architecture

    View full-size slide

  23. Storage Requirements
    ● Storage for Image uploads and
    processing
    ○ Notification of new Images
    ○ Direct access from Mobile App
    ● Application Level Data: Users,
    Comments, Images, etc
    ○ Scalable, managed, Easy of Use
    ● Counter for Likes. Storage for
    generated timelines
    Storage

    View full-size slide

  24. Redis
    ● Key-value cache and store
    ○ Fast, in-memory access
    ● Values can be rich data types
    ○ lists, sets & sorted sets, etc
    ○ Great for Counters
    ● Click to Deploy on GCP
    https://redis.io

    View full-size slide

  25. Redis Click to Deploy
    ● Configure a Redis Cluster in
    seconds
    ● Specify
    ○ Node count
    ○ Virtual Machine type
    [Optional]
    ○ Number of persistent
    nodes [Optional]
    https://cloud.google.com/solutions/redis/click-to-deploy

    View full-size slide

  26. Abelana App
    Storage
    Image
    formatter
    Abelana Server
    Abelana architecture

    View full-size slide

  27. How to integrate?

    View full-size slide

  28. Abelana App
    Storage
    Image
    formatter
    Abelana Server
    Abelana architecture

    View full-size slide

  29. ● Simple API + Minimal Coding
    ○ Client Library Support
    ○ Authentication via different
    providers
    ● Reliable and highly available
    ● Scalable
    Application Backend Integration
    Abelana App
    Abelana Server

    View full-size slide

  30. iOS
    Cloud
    Endpoints
    ● Create APIs for Mobile and Gaming
    Backends
    ● Decorate client interface application code
    or generate Endpoint classes from
    Models
    ● Discoverable, Restful APIs implemented
    on top of Google’s API Infrastructure
    ● Tools for generating mobile optimized
    Client Libraries for Android, iOS and Web
    ● OAuth 2.0 support and client key
    management
    Cloud Endpoints
    Abelana Server

    View full-size slide

  31. Java - App Engine
    @Api(name=”comment” version=”v1”)
    public class CommentsEndpoint
    @ApiMethod(httpMethod = "GET", path = "{personid}/{photoid}")
    public List getComments(
    @Named("photoid") long photoId, @Named(“personid”) long personId)
    throws UnauthorizedException, NotFoundException {
    List results = comments.query(personId, photoId);
    return results;
    }
    }
    // REST call = /comment/v1/{userid}/{photoid}
    public class CommentsTask extends ServiceTask {
    protected void executeEndpointCall() {
    service.commentsEndpoint().getComments(photoId, personId).execute();
    }
    Android App

    View full-size slide

  32. Firebase: Realtime Application Platform
    Realtime Database User Management Hosting

    View full-size slide

  33. Abelana App
    Storage
    Image
    formatter
    Abelana Server
    Abelana architecture

    View full-size slide

  34. ● Automatic notification of new
    images
    ● Background Processing - Outside
    of User Request
    ● Queue based system
    ○ Auto retry
    ○ Rate configurable
    ● Minimal configuration and
    management
    Image Formatter / Storage Integration
    Storage
    Image
    formatter
    Abelana Server

    View full-size slide

  35. ● Allow work to be performed
    outside of a user request
    ● Push or Pull based queueing
    system
    ● Automatic Retries + Exponential
    backoff
    ● Close to zero configuration
    App Engine Task queues

    View full-size slide

  36. Image Processing Flow
    Worker
    Task Queue
    /process_image?url=http://storage.googleapis.com/images-in/...
    Abelana
    Server
    Uploaded Images
    Bucket Object Notifications
    Processed Images
    Bucket

    View full-size slide

  37. Abelana App
    Storage
    Image
    formatter
    Abelana Server
    Abelana architecture
    VM
    VM
    VM
    Instance Group

    View full-size slide

  38. Alternate Design Options
    Wix Media Platform
    http://wixmp.com/google

    View full-size slide

  39. Abelana App
    Storage
    Image
    formatter
    Abelana Server
    Abelana architecture
    VM
    VM
    VM
    Instance Group

    View full-size slide

  40. Abelana Server
    Abelana architecture
    Abelana App
    Wix Media Platform

    View full-size slide

  41. Wix Media by the Numbers
    55
    million
    1.5 TB
    1.5
    billion
    35 TB
    Users
    Daily Uploads
    Daily Requests
    Daily Bandwidth

    View full-size slide

  42. Wix Media Platform
    ● Real-time Image Manipulation
    ● Audio and Video transcoding
    ● CDN
    ● Media Manager and Playground
    ● SDKs

    View full-size slide

  43. App Engine
    Media Manager
    Compute Engine
    Runtime App
    Transcoders
    NORM Workers
    Rembrandt Workers
    Cloud Storage
    Memcache
    Task Queue
    PubSub
    Datastore
    Metadata
    APIs
    GLB
    CDN

    View full-size slide

  44. The world’s fastest,
    most reliable
    media management system
    Available today for GCP

    View full-size slide

  45. Primary Design Considerations:
    ● Where best to run your application components
    ● Where to store various types of data
    ● How to effectively integrate the various components of your app
    Use a Modular Design for flexibility, use Managed Services where possible
    Wix Media Platform is a collection of services for storing, serving,
    uploading, and managing image, audio, and video files.
    Google Cloud Platform has everything you need to design and
    build applications
    Key Takeaways

    View full-size slide

  46. Thanks!
    cloud.google.com

    View full-size slide