SlideShare ist ein Scribd-Unternehmen logo
1 von 64
High Replication
   Datastore
    Ikai Lan - @ikai
    Esto es Google
    August 9th, 2011
About the speaker

• Developer Relations at Google based out
  of San Francisco, CA
• Google+: http://plus.ikailan.com
• Twitter: @ikai
About the speaker
BIOGRAFÍA: Ikai es ingeniero de Desarrollo de
Programas en el motor de Google App. Antes de
Google, trabajó como ingeniero programador
construyendo aplicaciones para móviles y redes
sociales en LinkedIn. Ikai es un ávido de la
tecnología, consumiendo cantidades de material
acerca de nuevos lenguajes de programación,
estructuras o servicios. En sus ratos libres disfruta
de California, ganando concursos de karaoke
chino y jugando futbol de bandera. Actualmente
vive en el área de la Bahía de San Francisco,
donde agoniza viendo como su equipo favorito
explota temporada tras temporada.



    English original: http://code.google.com/team/
About the speaker
BIOGRAFÍA: Ikai es ingeniero de Desarrollo de
Programas en el motor de Google App. Antes de
Google, trabajó como ingeniero programador
construyendo aplicaciones para móviles y redes
sociales en LinkedIn. Ikai es un ávido de la
tecnología, consumiendo cantidades de material
acerca de nuevos lenguajes de programación,
estructuras o servicios. En sus ratos libres disfruta
de California, ganando concursos de karaoke
chino y jugando futbol de bandera. Actualmente
vive en el área de la Bahía de San Francisco,
donde agoniza viendo como su equipo favorito
explota temporada tras temporada.                       !!!

    English original: http://code.google.com/team/
Agenda

• What is Google App Engine?
• Intro to High Replication Datastore
• How does High Replication work under
  the hood?
If you’re not an App
   Engine developer ..
• First off, shame on you
• The code in these examples might not
  make sense
• The concepts in these slides are always
  good to understand
SaaS

PaaS


IaaS

       Source: Gartner AADI Summit Dec 2009
SaaS

PaaS


IaaS

       Source: Gartner AADI Summit Dec 2009
SaaS

PaaS


IaaS

       Source: Gartner AADI Summit Dec 2009
SaaS

PaaS


IaaS

       Source: Gartner AADI Summit Dec 2009
SDK & “The Cloud”

Hardware

Networking

Operating system

Application runtime

   Java, Python

Static file serving

                      20
Duke, the Java mascot
Go Gopher    Copyright © Sun Microsystems Inc., all rights reserved.
Dynamic Scaling: Low traffic



                            App
                           Server




22
Dynamic Scaling: Low traffic



                            App
                           Server




22
Dynamic Scaling: Grows with
     demand


                          App
                           App
                         Server
                             App
                          Server
                           Server




22
Dynamic Scaling: Grows with
     demand


                          App
                           App
                         Server
                             App
                          Server
                           Server




22
Dynamic Scaling: Grows with
     demand


                          App
                           App
                         Server
                             App
                          Server
                           Server




22
Dynamic Scaling: Grows with
     demand


                          App
                           App
                         Server
                             App
                          Server
                           Server




22
150,000+ Apps
100,000+ Developers
2B Page views / day
Customer: WebFilings




Disruptive multi-tenant App Engine application adopted by
Fortune 500 companies.
Customer: The Royal Wedding




Peak: 32,000 requests a second with no disruption!
Core APIs
Memcache      Datastore   URL Fetch




  Mail         XMPP       Task Queue




 Images       Blobstore   User Service
App Engine
     Datastore
  Schemaless, non-relational
   datastore built on top of
 Google’s Bigtable technology

Enables rapid development
       and scalability
High Replication
• Strongly consistent
• Multi-data center
• Consistent
  performance
• High Reliability
• No data loss
How do I use it?

• Create a new application! Just remember
  the rules
• Fetch by key and ancestor queries exhibit
  strongly consistent behavior

• Queries without an ancestor exhibit
  eventually consistent behavior
Strong vs. Eventual
• Strong consistency means immediately after
  the datastore tells us a write has been
  committed, the effects of that write are
  immediately visible
• Eventual consistency means that after the
  datastore tells us a write has been
  committed, the effects of that write are
  visible after some time
Strong Consistency
Eventual Consistency
This is strongly consistent
DatastoreService datastore = DatastoreServiceFactory
	 	 	 	 .getDatastoreService();
	 	
Entity item = new Entity("Item");
item.setProperty("data", 123);
Key key = datastore.put(item);

// This exhibits strong consistency.
// It should return the item we just saved.
Entity result = datastore.get(key);




                    Get by key
This is strongly consistent
// Save the entity root
Entity root = new Entity("Root");
Key rootKey = datastore.put(root);

// Save the child
Entity childItem = new Entity("Item", rootKey);
                                                  Ancestor
childItem.setProperty("data", 123);
datastore.put(childItem);
                                                   query
Query strongConsistencyQuery = new Query("Item");
strongConsistencyQuery.setAncestor(rootKey);
strongConsistencyQuery.addFilter("data", FilterOperator.EQUAL, 123);
FetchOptions opts = FetchOptions.Builder.withDefaults();

// This query exhibits strong consistency.
// It will return the item we just saved.
List<Entity> results = datastore.prepare(strongConsistencyQuery)
	 	 .asList(opts);
This is eventually consistent
Entity item = new Entity("Item");
item.setProperty("data", 123);
datastore.put(item);

// Not an ancestor query
Query eventuallyConsistentQuery = new Query("Item");
eventuallyConsistentQuery.addFilter("data", FilterOperator.EQUAL, 123);
FetchOptions opts = FetchOptions.Builder.withDefaults();

// This query exhibits eventual consistency.
// It will likely return an empty list.
List<Entity> results = datastore.prepare(eventuallyConsistentQuery)
	 	 	 	 .asList(opts);
Why?

• Reads are transactional
• On a read, we try to determine if we have
  the latest version of data
• If not, we catch up the local node to the
  latest version
To understand this ..

• We need some understanding of our
  implementation of Paxos
• ...which necessitates some understanding of
  transactions
• ... which necessitates some some
  understanding of entity groups
Under the hood
Entity Groups
Entity
                              User
group root


                     Blog            Blog


             Entry          Entry      Entry


      Comment
      Comment                               Comment
Entity group root
// Save the entity root
Entity root = new Entity("Root");
Key rootKey = datastore.put(root);

// Save the child
Entity childItem = new Entity("Item", rootKey);
childItem.setProperty("data", 123);
datastore.put(childItem);

Query strongConsistencyQuery = new Query("Item");
strongConsistencyQuery.setAncestor(rootKey);
strongConsistencyQuery.addFilter("data", FilterOperator.EQUAL, 123);
FetchOptions opts = FetchOptions.Builder.withDefaults();

// This query exhibits strong consistency.
// It will return the item we just saved.
List<Entity> results = datastore.prepare(strongConsistencyQuery)
	 	 .asList(opts);
Entity group root
Entity
             Root
group root
Adding an entity child
// Save the entity root
Entity root = new Entity("Root");
Key rootKey = datastore.put(root);

// Save the child
Entity childItem = new Entity("Item", rootKey);
childItem.setProperty("data", 123);
datastore.put(childItem);

Query strongConsistencyQuery = new Query("Item");
strongConsistencyQuery.setAncestor(rootKey);
strongConsistencyQuery.addFilter("data", FilterOperator.EQUAL, 123);
FetchOptions opts = FetchOptions.Builder.withDefaults();

// This query exhibits strong consistency.
// It will return the item we just saved.
List<Entity> results = datastore.prepare(strongConsistencyQuery)
	 	 .asList(opts);
Entity Groups
                        Root


We added         Item
a child
Entity Groups
                        Root


We added         Item
a child



                   Transactions “lock”
                      on this entity
Transactional reads



     Datastore

                 Version 11
Transactional reads

 App
Server    Data read begins



                       Datastore

                                   Version 11
Transactional reads
                                    Version 12 of data
                                   Still being committed


 App                                                        App
Server    Data read begins                                 Server


                       Datastore

                                                   Version 11
Transactional reads
                                             Version 12 of data
                                            Still being committed


 App                                                                 App
Server    Data read begins                                          Server


                       Datastore

                                                            Version 11
                         Version 11 of data
                       returned - this is fully
                        committed version
Optimistic locking
 Optimistic because
    you assume
most of the time no
  modifications will
occur while you have
object out - you only
 do work when this
      isn’t true
Optimistic Locking


     Datastore

                 Version 11
Optimistic Locking
 App
Server   Data read begins




                     Datastore

                                 Version 11
Optimistic Locking
      App
     Server          Data read begins




                                 Datastore
Version 11 of data



                                             Version 11
Optimistic Locking
                                           Version 12 of data
      App                                 Finished committed.        App
     Server          Data read begins   Datastore has version 12.   Server


                                 Datastore
Version 11 of data



                                                            Version 11
Optimistic Locking
                                           Version 12 of data
      App                                 Finished committed.        App
     Server          Data read begins   Datastore has version 12.   Server


                                 Datastore
Version 11 of data



                                                            Version 12
Optimistic Locking
                                           Version 12 of data
      App                                 Finished committed.        App
     Server          Data read begins   Datastore has version 12.   Server


                                 Datastore
Version 11 of data
                 Write data back

                                                            Version 12
Optimistic Locking
                                            Version 12 of data
      App                                  Finished committed.        App
     Server          Data read begins    Datastore has version 12.   Server


                                 Datastore
Version 11 of data
                 Write data back

                                                             Version 12
               Trying to write back to
                datastore: exception!

                 Another client has
                   modified data
Life of a distributed write

 1. Writes to the
journal of multiple
    datastores
                       App
                      Server

 2. Returns once
    datastores
  acknowledge
 receiving write
Life of a distributed write
             (part 2)
                    The journal tracks
                    writes that need to
                        be applied
  Write being        Item 1       <data>
   applied           Version 25

                     Item 5       <data>
                     Version 12
  Write to be        Item 1       <data>
applied in future    Version 26
Transactional reads
               Local datastore up to date
 App
Server
                                              Is the item caught up
                                               to the latest journal
           Tries to read from                          write?
             local datastore
                               Journal
    Applied.      Item 1             <data>
                  Version 25


    Applied.      Item 5             <data>
                  Version 12


    Applied.      Item 1             <data>
                  Version 26
Transactional reads
               Local datastore up to date
 App
Server
                                              Is the item caught up
                                               to the latest journal
           Tries to read from                          write?
             local datastore
                                                        Yes!
                               Journal
    Applied.      Item 1             <data>          Return the
                  Version 25
                                                     data in the
                  Item 5             <data>
    Applied.
                  Version 12                         datastore
    Applied.      Item 1             <data>
                  Version 26
Transactional reads
         Local datastore not up to date - Step 1
 App                                          Is the item caught up
Server                                         to the latest journal
                                                       write?
           Tries to read from
             local datastore
                               Journal
    Applied.      Item 1             <data>
                  Version 25


    Applied.      Item 5             <data>
                  Version 12


   Unapplied.     Item 1             <data>
                  Version 26
Transactional reads
         Local datastore not up to date - Step 1
 App                                          Is the item caught up
Server                                         to the latest journal
                                                       write?
           Tries to read from
             local datastore
                                                        No.
                               Journal
    Applied.      Item 1             <data>           Catch the
                  Version 25
                                                      local data
                  Item 5             <data>
    Applied.
                  Version 12                             up
   Unapplied.     Item 1             <data>
                  Version 26
Transactional reads
         Local datastore not up to date - Step 2

                                  All datastores either:
             Waits for local     return up-to-date data
 App       datastore to return      or force catch up
Server
           Request data from
           remote datastore        App uses data from
                                   first datastore that
           Request data from           responds
           remote datastore
More reading

• My example was grossly oversimplified
• More details can be found here:
  http://www.cidrdb.org/cidr2011/Papers/
  CIDR11_Paper32.pdf
Contradictory advice

• Entity groups must be as big as possible to
  cover as much related data as you can
• Entity groups must be small enough such
  that your write rate per entity group never
  goes above one write/second
Summary
• Remember the rules of strong consistency
  vs. eventual consistency
• Group your data into entity groups and use
  ancestor queries when possible
• App Engine’s datastore gives you the best
  of all worlds: high reliability and
  strong data consistency
Questions?


• Google+: http://plus.ikailan.com
• Twitter: @ikai

Weitere ähnliche Inhalte

Was ist angesagt?

How Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fastHow Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fastAtlassian
 
Salesforce Lightning Web Components Overview
Salesforce Lightning Web Components OverviewSalesforce Lightning Web Components Overview
Salesforce Lightning Web Components OverviewNagarjuna Kaipu
 
Preparing for Data Residency and Custom Domains
Preparing for Data Residency and Custom DomainsPreparing for Data Residency and Custom Domains
Preparing for Data Residency and Custom DomainsAtlassian
 
Google Cloud - Scale With A Smile (Dec 2014)
Google Cloud - Scale With A Smile (Dec 2014)Google Cloud - Scale With A Smile (Dec 2014)
Google Cloud - Scale With A Smile (Dec 2014)Ido Green
 
Declaring Server App Components in Pure Java
Declaring Server App Components in Pure JavaDeclaring Server App Components in Pure Java
Declaring Server App Components in Pure JavaAtlassian
 
Node.CQ - Creating Real-time Data Mashups with Node.JS and Adobe CQ
Node.CQ - Creating Real-time Data Mashups with Node.JS and Adobe CQNode.CQ - Creating Real-time Data Mashups with Node.JS and Adobe CQ
Node.CQ - Creating Real-time Data Mashups with Node.JS and Adobe CQJoshua Miller
 
Integrating Jira Software Cloud With the AWS Code Suite
Integrating Jira Software Cloud With the AWS Code SuiteIntegrating Jira Software Cloud With the AWS Code Suite
Integrating Jira Software Cloud With the AWS Code SuiteAtlassian
 
Web api scalability and performance
Web api scalability and performanceWeb api scalability and performance
Web api scalability and performanceHimanshu Desai
 
Rails and iOS with RestKit
Rails and iOS with RestKitRails and iOS with RestKit
Rails and iOS with RestKitAndrew Culver
 
Making connected apps with BaaS (Droidcon Bangalore 2014)
Making connected apps with BaaS (Droidcon Bangalore 2014)Making connected apps with BaaS (Droidcon Bangalore 2014)
Making connected apps with BaaS (Droidcon Bangalore 2014)Varun Torka
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersScaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersoazabir
 
Creating a Custom PowerApp Connector using Azure Functions
Creating a Custom PowerApp Connector using Azure FunctionsCreating a Custom PowerApp Connector using Azure Functions
Creating a Custom PowerApp Connector using Azure FunctionsMurray Fife
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for JavaLars Vogel
 
Firebase Dev Day Bangkok: Keynote
Firebase Dev Day Bangkok: KeynoteFirebase Dev Day Bangkok: Keynote
Firebase Dev Day Bangkok: KeynoteSittiphol Phanvilai
 
Devfest SouthWest, Nigeria - Firebase
Devfest SouthWest, Nigeria - FirebaseDevfest SouthWest, Nigeria - Firebase
Devfest SouthWest, Nigeria - FirebaseMoyinoluwa Adeyemi
 
Microservices Testing Strategies JUnit Cucumber Mockito Pact
Microservices Testing Strategies JUnit Cucumber Mockito PactMicroservices Testing Strategies JUnit Cucumber Mockito Pact
Microservices Testing Strategies JUnit Cucumber Mockito PactAraf Karsh Hamid
 

Was ist angesagt? (20)

How Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fastHow Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fast
 
Building Web APIs that Scale
Building Web APIs that ScaleBuilding Web APIs that Scale
Building Web APIs that Scale
 
Salesforce Lightning Web Components Overview
Salesforce Lightning Web Components OverviewSalesforce Lightning Web Components Overview
Salesforce Lightning Web Components Overview
 
Preparing for Data Residency and Custom Domains
Preparing for Data Residency and Custom DomainsPreparing for Data Residency and Custom Domains
Preparing for Data Residency and Custom Domains
 
Google Cloud - Scale With A Smile (Dec 2014)
Google Cloud - Scale With A Smile (Dec 2014)Google Cloud - Scale With A Smile (Dec 2014)
Google Cloud - Scale With A Smile (Dec 2014)
 
Firebase Tech Talk By Atlogys
Firebase Tech Talk By AtlogysFirebase Tech Talk By Atlogys
Firebase Tech Talk By Atlogys
 
Declaring Server App Components in Pure Java
Declaring Server App Components in Pure JavaDeclaring Server App Components in Pure Java
Declaring Server App Components in Pure Java
 
Node.CQ - Creating Real-time Data Mashups with Node.JS and Adobe CQ
Node.CQ - Creating Real-time Data Mashups with Node.JS and Adobe CQNode.CQ - Creating Real-time Data Mashups with Node.JS and Adobe CQ
Node.CQ - Creating Real-time Data Mashups with Node.JS and Adobe CQ
 
Java EE 6 & Spring: A Lover's Quarrel
Java EE 6 & Spring: A Lover's QuarrelJava EE 6 & Spring: A Lover's Quarrel
Java EE 6 & Spring: A Lover's Quarrel
 
Integrating Jira Software Cloud With the AWS Code Suite
Integrating Jira Software Cloud With the AWS Code SuiteIntegrating Jira Software Cloud With the AWS Code Suite
Integrating Jira Software Cloud With the AWS Code Suite
 
What’s New in Amazon Aurora
What’s New in Amazon AuroraWhat’s New in Amazon Aurora
What’s New in Amazon Aurora
 
Web api scalability and performance
Web api scalability and performanceWeb api scalability and performance
Web api scalability and performance
 
Rails and iOS with RestKit
Rails and iOS with RestKitRails and iOS with RestKit
Rails and iOS with RestKit
 
Making connected apps with BaaS (Droidcon Bangalore 2014)
Making connected apps with BaaS (Droidcon Bangalore 2014)Making connected apps with BaaS (Droidcon Bangalore 2014)
Making connected apps with BaaS (Droidcon Bangalore 2014)
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersScaling asp.net websites to millions of users
Scaling asp.net websites to millions of users
 
Creating a Custom PowerApp Connector using Azure Functions
Creating a Custom PowerApp Connector using Azure FunctionsCreating a Custom PowerApp Connector using Azure Functions
Creating a Custom PowerApp Connector using Azure Functions
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for Java
 
Firebase Dev Day Bangkok: Keynote
Firebase Dev Day Bangkok: KeynoteFirebase Dev Day Bangkok: Keynote
Firebase Dev Day Bangkok: Keynote
 
Devfest SouthWest, Nigeria - Firebase
Devfest SouthWest, Nigeria - FirebaseDevfest SouthWest, Nigeria - Firebase
Devfest SouthWest, Nigeria - Firebase
 
Microservices Testing Strategies JUnit Cucumber Mockito Pact
Microservices Testing Strategies JUnit Cucumber Mockito PactMicroservices Testing Strategies JUnit Cucumber Mockito Pact
Microservices Testing Strategies JUnit Cucumber Mockito Pact
 

Ähnlich wie 2011 aug-gdd-mexico-city-high-replication-datastore

React Native Database: A Comprehensive Guideline on Choosing the Right Databa...
React Native Database: A Comprehensive Guideline on Choosing the Right Databa...React Native Database: A Comprehensive Guideline on Choosing the Right Databa...
React Native Database: A Comprehensive Guideline on Choosing the Right Databa...Katy Slemon
 
Automated Data Synchronization: Data Loader, Data Mirror & Beyond
Automated Data Synchronization: Data Loader, Data Mirror & BeyondAutomated Data Synchronization: Data Loader, Data Mirror & Beyond
Automated Data Synchronization: Data Loader, Data Mirror & BeyondJeremyOtt5
 
13h00 p duff-building-applications-with-aws-final
13h00   p duff-building-applications-with-aws-final13h00   p duff-building-applications-with-aws-final
13h00 p duff-building-applications-with-aws-finalLuiz Gustavo Santos
 
Top local databases for react native app development
Top local databases for react native app developmentTop local databases for react native app development
Top local databases for react native app developmentSameerShaik43
 
Microservices? Dynamic Infrastructure? - Adventures in Keeping Your Applicati...
Microservices? Dynamic Infrastructure? - Adventures in Keeping Your Applicati...Microservices? Dynamic Infrastructure? - Adventures in Keeping Your Applicati...
Microservices? Dynamic Infrastructure? - Adventures in Keeping Your Applicati...Amazon Web Services
 
We don’t need no stinkin app server! Building a Two-Tier Mobile App
We don’t need no stinkin app server! Building a Two-Tier Mobile AppWe don’t need no stinkin app server! Building a Two-Tier Mobile App
We don’t need no stinkin app server! Building a Two-Tier Mobile AppPat Patterson
 
Continuous delivery on the cloud
Continuous delivery on the cloudContinuous delivery on the cloud
Continuous delivery on the cloudAnand B Narasimhan
 
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023VMware Tanzu
 
Social Enterprise Java Apps on Heroku Webinar
Social Enterprise Java Apps on Heroku WebinarSocial Enterprise Java Apps on Heroku Webinar
Social Enterprise Java Apps on Heroku WebinarSalesforce Developers
 
List of Top Local Databases used for react native app developement in 2022
List of Top Local Databases used for react native app developement in 2022					List of Top Local Databases used for react native app developement in 2022
List of Top Local Databases used for react native app developement in 2022 Shelly Megan
 
Social ent. with java on heroku
Social ent. with java on herokuSocial ent. with java on heroku
Social ent. with java on herokuAnand B Narasimhan
 
AngularJSTO presentation
AngularJSTO presentationAngularJSTO presentation
AngularJSTO presentationAlan Hietala
 
VMware: Aplikačná platforma pre cloud (časť 2)
VMware: Aplikačná platforma pre cloud (časť 2)VMware: Aplikačná platforma pre cloud (časť 2)
VMware: Aplikačná platforma pre cloud (časť 2)ASBIS SK
 
Evolving Archetecture
Evolving ArchetectureEvolving Archetecture
Evolving Archetectureleo lapworth
 
Innovate Faster with Salesforce Heroku and AWS - CMP303 - re:Invent 2017
Innovate Faster with Salesforce Heroku and AWS - CMP303 - re:Invent 2017Innovate Faster with Salesforce Heroku and AWS - CMP303 - re:Invent 2017
Innovate Faster with Salesforce Heroku and AWS - CMP303 - re:Invent 2017Amazon Web Services
 
Daniel Myers (Snowflake) - Developer Journey_ The Evolution of Data Applications
Daniel Myers (Snowflake) - Developer Journey_ The Evolution of Data ApplicationsDaniel Myers (Snowflake) - Developer Journey_ The Evolution of Data Applications
Daniel Myers (Snowflake) - Developer Journey_ The Evolution of Data ApplicationsTechsylvania
 

Ähnlich wie 2011 aug-gdd-mexico-city-high-replication-datastore (20)

React Native Database: A Comprehensive Guideline on Choosing the Right Databa...
React Native Database: A Comprehensive Guideline on Choosing the Right Databa...React Native Database: A Comprehensive Guideline on Choosing the Right Databa...
React Native Database: A Comprehensive Guideline on Choosing the Right Databa...
 
Automated Data Synchronization: Data Loader, Data Mirror & Beyond
Automated Data Synchronization: Data Loader, Data Mirror & BeyondAutomated Data Synchronization: Data Loader, Data Mirror & Beyond
Automated Data Synchronization: Data Loader, Data Mirror & Beyond
 
13h00 p duff-building-applications-with-aws-final
13h00   p duff-building-applications-with-aws-final13h00   p duff-building-applications-with-aws-final
13h00 p duff-building-applications-with-aws-final
 
Building Applications with AWS
Building Applications with AWSBuilding Applications with AWS
Building Applications with AWS
 
Top local databases for react native app development
Top local databases for react native app developmentTop local databases for react native app development
Top local databases for react native app development
 
Microservices? Dynamic Infrastructure? - Adventures in Keeping Your Applicati...
Microservices? Dynamic Infrastructure? - Adventures in Keeping Your Applicati...Microservices? Dynamic Infrastructure? - Adventures in Keeping Your Applicati...
Microservices? Dynamic Infrastructure? - Adventures in Keeping Your Applicati...
 
We don’t need no stinkin app server! Building a Two-Tier Mobile App
We don’t need no stinkin app server! Building a Two-Tier Mobile AppWe don’t need no stinkin app server! Building a Two-Tier Mobile App
We don’t need no stinkin app server! Building a Two-Tier Mobile App
 
React Native Workshop
React Native WorkshopReact Native Workshop
React Native Workshop
 
Continuous delivery on the cloud
Continuous delivery on the cloudContinuous delivery on the cloud
Continuous delivery on the cloud
 
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
 
Social Enterprise Java Apps on Heroku Webinar
Social Enterprise Java Apps on Heroku WebinarSocial Enterprise Java Apps on Heroku Webinar
Social Enterprise Java Apps on Heroku Webinar
 
List of Top Local Databases used for react native app developement in 2022
List of Top Local Databases used for react native app developement in 2022					List of Top Local Databases used for react native app developement in 2022
List of Top Local Databases used for react native app developement in 2022
 
Social ent. with java on heroku
Social ent. with java on herokuSocial ent. with java on heroku
Social ent. with java on heroku
 
AngularJSTO presentation
AngularJSTO presentationAngularJSTO presentation
AngularJSTO presentation
 
VMware: Aplikačná platforma pre cloud (časť 2)
VMware: Aplikačná platforma pre cloud (časť 2)VMware: Aplikačná platforma pre cloud (časť 2)
VMware: Aplikačná platforma pre cloud (časť 2)
 
Evolving Archetecture
Evolving ArchetectureEvolving Archetecture
Evolving Archetecture
 
Fluentd meetup #3
Fluentd meetup #3Fluentd meetup #3
Fluentd meetup #3
 
Innovate Faster with Salesforce Heroku and AWS - CMP303 - re:Invent 2017
Innovate Faster with Salesforce Heroku and AWS - CMP303 - re:Invent 2017Innovate Faster with Salesforce Heroku and AWS - CMP303 - re:Invent 2017
Innovate Faster with Salesforce Heroku and AWS - CMP303 - re:Invent 2017
 
Suresh Resume
Suresh ResumeSuresh Resume
Suresh Resume
 
Daniel Myers (Snowflake) - Developer Journey_ The Evolution of Data Applications
Daniel Myers (Snowflake) - Developer Journey_ The Evolution of Data ApplicationsDaniel Myers (Snowflake) - Developer Journey_ The Evolution of Data Applications
Daniel Myers (Snowflake) - Developer Journey_ The Evolution of Data Applications
 

Mehr von ikailan

Your language doesn't scale
Your language doesn't scaleYour language doesn't scale
Your language doesn't scaleikailan
 
From 0-1 billion in 46 days
From 0-1 billion in 46 daysFrom 0-1 billion in 46 days
From 0-1 billion in 46 daysikailan
 
2011 july-nyc-gtug-go
2011 july-nyc-gtug-go2011 july-nyc-gtug-go
2011 july-nyc-gtug-goikailan
 
2011 july-gtug-high-replication-datastore
2011 july-gtug-high-replication-datastore2011 july-gtug-high-replication-datastore
2011 july-gtug-high-replication-datastoreikailan
 
Intro to App Engine - Agency Dev Day NYC 2011
Intro to App Engine - Agency Dev Day NYC 2011Intro to App Engine - Agency Dev Day NYC 2011
Intro to App Engine - Agency Dev Day NYC 2011ikailan
 
2011 june-kuala-lumpur-gtug-hackathon
2011 june-kuala-lumpur-gtug-hackathon2011 june-kuala-lumpur-gtug-hackathon
2011 june-kuala-lumpur-gtug-hackathonikailan
 
2011 June - Singapore GTUG presentation. App Engine program update + intro to Go
2011 June - Singapore GTUG presentation. App Engine program update + intro to Go2011 June - Singapore GTUG presentation. App Engine program update + intro to Go
2011 June - Singapore GTUG presentation. App Engine program update + intro to Goikailan
 
Rapid web development using tornado web and mongodb
Rapid web development using tornado web and mongodbRapid web development using tornado web and mongodb
Rapid web development using tornado web and mongodbikailan
 
Introducing the App Engine datastore
Introducing the App Engine datastoreIntroducing the App Engine datastore
Introducing the App Engine datastoreikailan
 
OSCON Google App Engine Codelab - July 2010
OSCON Google App Engine Codelab - July 2010OSCON Google App Engine Codelab - July 2010
OSCON Google App Engine Codelab - July 2010ikailan
 
Building TweetEngine
Building TweetEngineBuilding TweetEngine
Building TweetEngineikailan
 

Mehr von ikailan (11)

Your language doesn't scale
Your language doesn't scaleYour language doesn't scale
Your language doesn't scale
 
From 0-1 billion in 46 days
From 0-1 billion in 46 daysFrom 0-1 billion in 46 days
From 0-1 billion in 46 days
 
2011 july-nyc-gtug-go
2011 july-nyc-gtug-go2011 july-nyc-gtug-go
2011 july-nyc-gtug-go
 
2011 july-gtug-high-replication-datastore
2011 july-gtug-high-replication-datastore2011 july-gtug-high-replication-datastore
2011 july-gtug-high-replication-datastore
 
Intro to App Engine - Agency Dev Day NYC 2011
Intro to App Engine - Agency Dev Day NYC 2011Intro to App Engine - Agency Dev Day NYC 2011
Intro to App Engine - Agency Dev Day NYC 2011
 
2011 june-kuala-lumpur-gtug-hackathon
2011 june-kuala-lumpur-gtug-hackathon2011 june-kuala-lumpur-gtug-hackathon
2011 june-kuala-lumpur-gtug-hackathon
 
2011 June - Singapore GTUG presentation. App Engine program update + intro to Go
2011 June - Singapore GTUG presentation. App Engine program update + intro to Go2011 June - Singapore GTUG presentation. App Engine program update + intro to Go
2011 June - Singapore GTUG presentation. App Engine program update + intro to Go
 
Rapid web development using tornado web and mongodb
Rapid web development using tornado web and mongodbRapid web development using tornado web and mongodb
Rapid web development using tornado web and mongodb
 
Introducing the App Engine datastore
Introducing the App Engine datastoreIntroducing the App Engine datastore
Introducing the App Engine datastore
 
OSCON Google App Engine Codelab - July 2010
OSCON Google App Engine Codelab - July 2010OSCON Google App Engine Codelab - July 2010
OSCON Google App Engine Codelab - July 2010
 
Building TweetEngine
Building TweetEngineBuilding TweetEngine
Building TweetEngine
 

Kürzlich hochgeladen

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Kürzlich hochgeladen (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

2011 aug-gdd-mexico-city-high-replication-datastore

  • 1.
  • 2. High Replication Datastore Ikai Lan - @ikai Esto es Google August 9th, 2011
  • 3. About the speaker • Developer Relations at Google based out of San Francisco, CA • Google+: http://plus.ikailan.com • Twitter: @ikai
  • 4. About the speaker BIOGRAFÍA: Ikai es ingeniero de Desarrollo de Programas en el motor de Google App. Antes de Google, trabajó como ingeniero programador construyendo aplicaciones para móviles y redes sociales en LinkedIn. Ikai es un ávido de la tecnología, consumiendo cantidades de material acerca de nuevos lenguajes de programación, estructuras o servicios. En sus ratos libres disfruta de California, ganando concursos de karaoke chino y jugando futbol de bandera. Actualmente vive en el área de la Bahía de San Francisco, donde agoniza viendo como su equipo favorito explota temporada tras temporada. English original: http://code.google.com/team/
  • 5. About the speaker BIOGRAFÍA: Ikai es ingeniero de Desarrollo de Programas en el motor de Google App. Antes de Google, trabajó como ingeniero programador construyendo aplicaciones para móviles y redes sociales en LinkedIn. Ikai es un ávido de la tecnología, consumiendo cantidades de material acerca de nuevos lenguajes de programación, estructuras o servicios. En sus ratos libres disfruta de California, ganando concursos de karaoke chino y jugando futbol de bandera. Actualmente vive en el área de la Bahía de San Francisco, donde agoniza viendo como su equipo favorito explota temporada tras temporada. !!! English original: http://code.google.com/team/
  • 6. Agenda • What is Google App Engine? • Intro to High Replication Datastore • How does High Replication work under the hood?
  • 7. If you’re not an App Engine developer .. • First off, shame on you • The code in these examples might not make sense • The concepts in these slides are always good to understand
  • 8. SaaS PaaS IaaS Source: Gartner AADI Summit Dec 2009
  • 9. SaaS PaaS IaaS Source: Gartner AADI Summit Dec 2009
  • 10. SaaS PaaS IaaS Source: Gartner AADI Summit Dec 2009
  • 11. SaaS PaaS IaaS Source: Gartner AADI Summit Dec 2009
  • 12. SDK & “The Cloud” Hardware Networking Operating system Application runtime Java, Python Static file serving 20
  • 13. Duke, the Java mascot Go Gopher Copyright © Sun Microsystems Inc., all rights reserved.
  • 14. Dynamic Scaling: Low traffic App Server 22
  • 15. Dynamic Scaling: Low traffic App Server 22
  • 16. Dynamic Scaling: Grows with demand App App Server App Server Server 22
  • 17. Dynamic Scaling: Grows with demand App App Server App Server Server 22
  • 18. Dynamic Scaling: Grows with demand App App Server App Server Server 22
  • 19. Dynamic Scaling: Grows with demand App App Server App Server Server 22
  • 21. Customer: WebFilings Disruptive multi-tenant App Engine application adopted by Fortune 500 companies.
  • 22. Customer: The Royal Wedding Peak: 32,000 requests a second with no disruption!
  • 23. Core APIs Memcache Datastore URL Fetch Mail XMPP Task Queue Images Blobstore User Service
  • 24. App Engine Datastore Schemaless, non-relational datastore built on top of Google’s Bigtable technology Enables rapid development and scalability
  • 25. High Replication • Strongly consistent • Multi-data center • Consistent performance • High Reliability • No data loss
  • 26. How do I use it? • Create a new application! Just remember the rules • Fetch by key and ancestor queries exhibit strongly consistent behavior • Queries without an ancestor exhibit eventually consistent behavior
  • 27. Strong vs. Eventual • Strong consistency means immediately after the datastore tells us a write has been committed, the effects of that write are immediately visible • Eventual consistency means that after the datastore tells us a write has been committed, the effects of that write are visible after some time
  • 30. This is strongly consistent DatastoreService datastore = DatastoreServiceFactory .getDatastoreService(); Entity item = new Entity("Item"); item.setProperty("data", 123); Key key = datastore.put(item); // This exhibits strong consistency. // It should return the item we just saved. Entity result = datastore.get(key); Get by key
  • 31. This is strongly consistent // Save the entity root Entity root = new Entity("Root"); Key rootKey = datastore.put(root); // Save the child Entity childItem = new Entity("Item", rootKey); Ancestor childItem.setProperty("data", 123); datastore.put(childItem); query Query strongConsistencyQuery = new Query("Item"); strongConsistencyQuery.setAncestor(rootKey); strongConsistencyQuery.addFilter("data", FilterOperator.EQUAL, 123); FetchOptions opts = FetchOptions.Builder.withDefaults(); // This query exhibits strong consistency. // It will return the item we just saved. List<Entity> results = datastore.prepare(strongConsistencyQuery) .asList(opts);
  • 32. This is eventually consistent Entity item = new Entity("Item"); item.setProperty("data", 123); datastore.put(item); // Not an ancestor query Query eventuallyConsistentQuery = new Query("Item"); eventuallyConsistentQuery.addFilter("data", FilterOperator.EQUAL, 123); FetchOptions opts = FetchOptions.Builder.withDefaults(); // This query exhibits eventual consistency. // It will likely return an empty list. List<Entity> results = datastore.prepare(eventuallyConsistentQuery) .asList(opts);
  • 33. Why? • Reads are transactional • On a read, we try to determine if we have the latest version of data • If not, we catch up the local node to the latest version
  • 34. To understand this .. • We need some understanding of our implementation of Paxos • ...which necessitates some understanding of transactions • ... which necessitates some some understanding of entity groups
  • 36. Entity Groups Entity User group root Blog Blog Entry Entry Entry Comment Comment Comment
  • 37. Entity group root // Save the entity root Entity root = new Entity("Root"); Key rootKey = datastore.put(root); // Save the child Entity childItem = new Entity("Item", rootKey); childItem.setProperty("data", 123); datastore.put(childItem); Query strongConsistencyQuery = new Query("Item"); strongConsistencyQuery.setAncestor(rootKey); strongConsistencyQuery.addFilter("data", FilterOperator.EQUAL, 123); FetchOptions opts = FetchOptions.Builder.withDefaults(); // This query exhibits strong consistency. // It will return the item we just saved. List<Entity> results = datastore.prepare(strongConsistencyQuery) .asList(opts);
  • 38. Entity group root Entity Root group root
  • 39. Adding an entity child // Save the entity root Entity root = new Entity("Root"); Key rootKey = datastore.put(root); // Save the child Entity childItem = new Entity("Item", rootKey); childItem.setProperty("data", 123); datastore.put(childItem); Query strongConsistencyQuery = new Query("Item"); strongConsistencyQuery.setAncestor(rootKey); strongConsistencyQuery.addFilter("data", FilterOperator.EQUAL, 123); FetchOptions opts = FetchOptions.Builder.withDefaults(); // This query exhibits strong consistency. // It will return the item we just saved. List<Entity> results = datastore.prepare(strongConsistencyQuery) .asList(opts);
  • 40. Entity Groups Root We added Item a child
  • 41. Entity Groups Root We added Item a child Transactions “lock” on this entity
  • 42. Transactional reads Datastore Version 11
  • 43. Transactional reads App Server Data read begins Datastore Version 11
  • 44. Transactional reads Version 12 of data Still being committed App App Server Data read begins Server Datastore Version 11
  • 45. Transactional reads Version 12 of data Still being committed App App Server Data read begins Server Datastore Version 11 Version 11 of data returned - this is fully committed version
  • 46. Optimistic locking Optimistic because you assume most of the time no modifications will occur while you have object out - you only do work when this isn’t true
  • 47. Optimistic Locking Datastore Version 11
  • 48. Optimistic Locking App Server Data read begins Datastore Version 11
  • 49. Optimistic Locking App Server Data read begins Datastore Version 11 of data Version 11
  • 50. Optimistic Locking Version 12 of data App Finished committed. App Server Data read begins Datastore has version 12. Server Datastore Version 11 of data Version 11
  • 51. Optimistic Locking Version 12 of data App Finished committed. App Server Data read begins Datastore has version 12. Server Datastore Version 11 of data Version 12
  • 52. Optimistic Locking Version 12 of data App Finished committed. App Server Data read begins Datastore has version 12. Server Datastore Version 11 of data Write data back Version 12
  • 53. Optimistic Locking Version 12 of data App Finished committed. App Server Data read begins Datastore has version 12. Server Datastore Version 11 of data Write data back Version 12 Trying to write back to datastore: exception! Another client has modified data
  • 54. Life of a distributed write 1. Writes to the journal of multiple datastores App Server 2. Returns once datastores acknowledge receiving write
  • 55. Life of a distributed write (part 2) The journal tracks writes that need to be applied Write being Item 1 <data> applied Version 25 Item 5 <data> Version 12 Write to be Item 1 <data> applied in future Version 26
  • 56. Transactional reads Local datastore up to date App Server Is the item caught up to the latest journal Tries to read from write? local datastore Journal Applied. Item 1 <data> Version 25 Applied. Item 5 <data> Version 12 Applied. Item 1 <data> Version 26
  • 57. Transactional reads Local datastore up to date App Server Is the item caught up to the latest journal Tries to read from write? local datastore Yes! Journal Applied. Item 1 <data> Return the Version 25 data in the Item 5 <data> Applied. Version 12 datastore Applied. Item 1 <data> Version 26
  • 58. Transactional reads Local datastore not up to date - Step 1 App Is the item caught up Server to the latest journal write? Tries to read from local datastore Journal Applied. Item 1 <data> Version 25 Applied. Item 5 <data> Version 12 Unapplied. Item 1 <data> Version 26
  • 59. Transactional reads Local datastore not up to date - Step 1 App Is the item caught up Server to the latest journal write? Tries to read from local datastore No. Journal Applied. Item 1 <data> Catch the Version 25 local data Item 5 <data> Applied. Version 12 up Unapplied. Item 1 <data> Version 26
  • 60. Transactional reads Local datastore not up to date - Step 2 All datastores either: Waits for local return up-to-date data App datastore to return or force catch up Server Request data from remote datastore App uses data from first datastore that Request data from responds remote datastore
  • 61. More reading • My example was grossly oversimplified • More details can be found here: http://www.cidrdb.org/cidr2011/Papers/ CIDR11_Paper32.pdf
  • 62. Contradictory advice • Entity groups must be as big as possible to cover as much related data as you can • Entity groups must be small enough such that your write rate per entity group never goes above one write/second
  • 63. Summary • Remember the rules of strong consistency vs. eventual consistency • Group your data into entity groups and use ancestor queries when possible • App Engine’s datastore gives you the best of all worlds: high reliability and strong data consistency

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. Does CLOUD COMPUTING just means your servers are SOMEWHERE ELSE? Or is it SOMETHING MORE?\nWHY put your servers in the cloud?\n- Don&amp;#x2019;t want to MANAGE servers?\n- Or is it the ELASTICITY and SCALABILITY of the cloud?\n- If so, you NEED: DISTRIBUTED cloud computing\n * TODAY we&amp;#x2019;ll talk about why\n
  8. Does CLOUD COMPUTING just means your servers are SOMEWHERE ELSE? Or is it SOMETHING MORE?\nWHY put your servers in the cloud?\n- Don&amp;#x2019;t want to MANAGE servers?\n- Or is it the ELASTICITY and SCALABILITY of the cloud?\n- If so, you NEED: DISTRIBUTED cloud computing\n * TODAY we&amp;#x2019;ll talk about why\n
  9. Does CLOUD COMPUTING just means your servers are SOMEWHERE ELSE? Or is it SOMETHING MORE?\nWHY put your servers in the cloud?\n- Don&amp;#x2019;t want to MANAGE servers?\n- Or is it the ELASTICITY and SCALABILITY of the cloud?\n- If so, you NEED: DISTRIBUTED cloud computing\n * TODAY we&amp;#x2019;ll talk about why\n
  10. \n
  11. \n
  12. SPECIALIZATION =&gt; SCALABILITY\n
  13. SPECIALIZATION =&gt; SCALABILITY\n
  14. SPECIALIZATION =&gt; SCALABILITY\n
  15. SPECIALIZATION =&gt; SCALABILITY\n
  16. SPECIALIZATION =&gt; SCALABILITY\n
  17. SPECIALIZATION =&gt; SCALABILITY\n
  18. \n
  19. \n
  20. \n
  21. SPECIALIZATION =&gt; SCALABILITY\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