SlideShare a Scribd company logo
High Replication
                              Datastore
                                    Ikai Lan
                               plus.ikailan.com
                                NYC GTUG
                                 July 27, 2011




Wednesday, July 27, 2011
About the speaker

                    • Ikai Lan
                    • Developer Relations at Google based out
                           of San Francisco, CA
                    • Twitter: @ikai
                    • Google+: plus.ikailan.com

Wednesday, July 27, 2011
Agenda

                    • What is App Engine?
                    • What is High Replication datastore?
                    • Underneath the hood


Wednesday, July 27, 2011
What is App Engine?



Wednesday, July 27, 2011
Software

                             Platform


                           Infrastructure

                                            Source: Gartner AADI Summit Dec 2009


Wednesday, July 27, 2011
Software

                             Platform


                           Infrastructure

                                            Source: Gartner AADI Summit Dec 2009


Wednesday, July 27, 2011
Software

                             Platform


                           Infrastructure

                                            Source: Gartner AADI Summit Dec 2009


Wednesday, July 27, 2011
Software

                             Platform


                           Infrastructure

                                            Source: Gartner AADI Summit Dec 2009


Wednesday, July 27, 2011
SDK & “The Cloud”

                 Hardware

                 Networking

                 Operating system

                 Application runtime

                           Java, Python, Go

                 Static file serving


Wednesday, July 27, 2011
Scales dynamically



                                        App
                                       Server




Wednesday, July 27, 2011
Scales dynamically

                                            App
                                           Server



                                        App
                                       Server



                                            App
                                           Server




Wednesday, July 27, 2011
Customer: WebFilings




  Disruptive multi-tenant App Engine application adopted by
  Fortune 500 companies.


Wednesday, July 27, 2011
Customer: The Royal Wedding




  Peaked at 32,000 requests per second with no disruption!




Wednesday, July 27, 2011
>100K Developers

                               >200K Apps

                           >1.5B daily pageviews


Wednesday, July 27, 2011
App Engine
                   Datastore
           Schemaless, non-relational
           datastore built on top of
           Google’s Bigtable technology

           Enables rapid development
           and scalability




Wednesday, July 27, 2011
High Replication
                • strongly consistent
                • multi datacenter
                • High reliability
                • consistent
                       performance
                • no data loss
Wednesday, July 27, 2011
How do I use HR?

                    • 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



Wednesday, July 27, 2011
Strong vs. Eventual
                    • Strong consistency means immediately after
                           the datastore tells us the data has been
                           committed, a subsequent read will return
                           the data written
                    • Eventual consistency means that some time
                           after the datastore tells us data has been
                           committed, a read will return written data -
                           immediate read may or may not

Wednesday, July 27, 2011
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);




Wednesday, July 27, 2011
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);
            	     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);



Wednesday, July 27, 2011
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);




Wednesday, July 27, 2011
Why?

                    • Reads are transactional
                    • On a read, we try to determine if we have
                           the latest version of some data
                    • If not, we catch up the data on the node to
                           the latest version



Wednesday, July 27, 2011
To understand this ...

                    • We need some understanding of Paxos ...
                    • ... which necessitates some understanding
                           of transactions
                    • ... which necessitates some understanding
                           of entity groups



Wednesday, July 27, 2011
Entity Groups
                           Entity
                                                         User
                           group root


                                                Blog            Blog


                                        Entry          Entry      Entry


                                 Comment
                                 Comment                               Comment



Wednesday, July 27, 2011
Entity groups
                 // 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);



Wednesday, July 27, 2011
Entity groups
                 // 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);



Wednesday, July 27, 2011
Optimistic locking
                            Client A reads                        Client B
                               data. It's                      reads data.
                                current                         It's current
                            version is 11                     version is 11




                              Modify data.                     Modify data.
                           Increment version                Increment version
                                 to 12          Datastore         to 12




                                                              Client B tries
                            Client ! tries to                 to save data.
                              save data.                        Success!
                               Datastore
                               version is
                            higher or equal
                                than my
                            version - FAIL



Wednesday, July 27, 2011
Transactional reads
                 // 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);



Wednesday, July 27, 2011
Transactional reads
                                                                                      Still being committed
                                                           Blog Entry
                                                           Version 11


                                                          Comment             Comment
                                                         Parent: Entry       Parent: Entry
                                                          Version 11          Version 12




                                                                                                   Client B
                  Client A reads
                                                           Datastore                           transactionally
                       data
                                                                                                 writing data



                                   Version 12 has not finished committing -
                                         Datastore returns version 11




Wednesday, July 27, 2011
Paxos simplified
                                       Give me the
                                       newest data        Node A                               Node B
                           Datastore
                            Client




                                                                   Is my data
                                                                   up to date?




                                                          Node C                               Node D




                                                     1. If the data is up to date, return it

                                                     2. if the data is NOT up to date, "catch up" the data
                                                     by applying the jobs in the journal and return the latest
                                                     data




Wednesday, July 27, 2011
More reading

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




Wednesday, July 27, 2011
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




Wednesday, July 27, 2011
Summary

                    • Remember the rules of strong consistency
                           and eventual consistency
                    • Group your data into entity groups when
                           possible and use ancestor queries




Wednesday, July 27, 2011
Questions?


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


Wednesday, July 27, 2011

More Related Content

Similar to 2011 july-gtug-high-replication-datastore

Infrastructure and Workflow for the Formal Evaluation of Semantic Search Tech...
Infrastructure and Workflow for the Formal Evaluation of Semantic Search Tech...Infrastructure and Workflow for the Formal Evaluation of Semantic Search Tech...
Infrastructure and Workflow for the Formal Evaluation of Semantic Search Tech...
Stuart Wrigley
 
SplunkLive New York 2011: DealerTrack
SplunkLive New York 2011: DealerTrackSplunkLive New York 2011: DealerTrack
SplunkLive New York 2011: DealerTrack
Splunk
 
Beyond Horizontal Scalability: Concurrency and Messaging Using Spring
Beyond Horizontal Scalability: Concurrency and Messaging Using SpringBeyond Horizontal Scalability: Concurrency and Messaging Using Spring
Beyond Horizontal Scalability: Concurrency and Messaging Using SpringBruce Snyder
 
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
ikailan
 
Building an experimentation framework
Building an experimentation frameworkBuilding an experimentation framework
Building an experimentation framework
zsqr
 
iPhone App from concept to product
iPhone App from concept to productiPhone App from concept to product
iPhone App from concept to product
joeysim
 
Anarchist guide to titanium ui
Anarchist guide to titanium uiAnarchist guide to titanium ui
Anarchist guide to titanium ui
Vincent Baskerville
 
Selenium Page Objects101
Selenium Page Objects101Selenium Page Objects101
Selenium Page Objects101
Adam Goucher
 
Time Series Data Storage in MongoDB
Time Series Data Storage in MongoDBTime Series Data Storage in MongoDB
Time Series Data Storage in MongoDB
sky_jackson
 
JavaSE - The road forward
JavaSE - The road forwardJavaSE - The road forward
JavaSE - The road forwardeug3n_cojocaru
 
Strudel: Framework for Transaction Performance Analyses on SQL/NoSQL Systems
Strudel: Framework for Transaction Performance Analyses on SQL/NoSQL SystemsStrudel: Framework for Transaction Performance Analyses on SQL/NoSQL Systems
Strudel: Framework for Transaction Performance Analyses on SQL/NoSQL Systems
tatemura
 
Mapping Java Objects with JPA
Mapping Java Objects with JPAMapping Java Objects with JPA
Mapping Java Objects with JPA
Aaron Schram
 
Governing services, data, rules, processes and more
Governing services, data, rules, processes and moreGoverning services, data, rules, processes and more
Governing services, data, rules, processes and more
Randall Hauch
 
Waters North American Trading Architecture Summit April 2011
Waters North American Trading Architecture Summit April 2011Waters North American Trading Architecture Summit April 2011
Waters North American Trading Architecture Summit April 2011
Matt Davey
 
PushToTest TestMaker 6.5 Open Source Test Design Document
PushToTest TestMaker 6.5 Open Source Test Design DocumentPushToTest TestMaker 6.5 Open Source Test Design Document
PushToTest TestMaker 6.5 Open Source Test Design Document
Clever Moe
 
Open Source Test Workshop for CIOs, CTOs, Managers
Open Source Test Workshop for CIOs, CTOs, ManagersOpen Source Test Workshop for CIOs, CTOs, Managers
Open Source Test Workshop for CIOs, CTOs, Managers
Clever Moe
 
Commercialization of OpenStack Object Storage
Commercialization of OpenStack Object StorageCommercialization of OpenStack Object Storage
Commercialization of OpenStack Object Storage
Joe Arnold
 
Monitoring is easy, why are we so bad at it presentation
Monitoring is easy, why are we so bad at it  presentationMonitoring is easy, why are we so bad at it  presentation
Monitoring is easy, why are we so bad at it presentationTheo Schlossnagle
 
Building Scalable Web Apps
Building Scalable Web AppsBuilding Scalable Web Apps
Building Scalable Web Apps
zeeg
 

Similar to 2011 july-gtug-high-replication-datastore (20)

STI Summit 2011 - Linked services
STI Summit 2011 - Linked servicesSTI Summit 2011 - Linked services
STI Summit 2011 - Linked services
 
Infrastructure and Workflow for the Formal Evaluation of Semantic Search Tech...
Infrastructure and Workflow for the Formal Evaluation of Semantic Search Tech...Infrastructure and Workflow for the Formal Evaluation of Semantic Search Tech...
Infrastructure and Workflow for the Formal Evaluation of Semantic Search Tech...
 
SplunkLive New York 2011: DealerTrack
SplunkLive New York 2011: DealerTrackSplunkLive New York 2011: DealerTrack
SplunkLive New York 2011: DealerTrack
 
Beyond Horizontal Scalability: Concurrency and Messaging Using Spring
Beyond Horizontal Scalability: Concurrency and Messaging Using SpringBeyond Horizontal Scalability: Concurrency and Messaging Using Spring
Beyond Horizontal Scalability: Concurrency and Messaging Using Spring
 
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
 
Building an experimentation framework
Building an experimentation frameworkBuilding an experimentation framework
Building an experimentation framework
 
iPhone App from concept to product
iPhone App from concept to productiPhone App from concept to product
iPhone App from concept to product
 
Anarchist guide to titanium ui
Anarchist guide to titanium uiAnarchist guide to titanium ui
Anarchist guide to titanium ui
 
Selenium Page Objects101
Selenium Page Objects101Selenium Page Objects101
Selenium Page Objects101
 
Time Series Data Storage in MongoDB
Time Series Data Storage in MongoDBTime Series Data Storage in MongoDB
Time Series Data Storage in MongoDB
 
JavaSE - The road forward
JavaSE - The road forwardJavaSE - The road forward
JavaSE - The road forward
 
Strudel: Framework for Transaction Performance Analyses on SQL/NoSQL Systems
Strudel: Framework for Transaction Performance Analyses on SQL/NoSQL SystemsStrudel: Framework for Transaction Performance Analyses on SQL/NoSQL Systems
Strudel: Framework for Transaction Performance Analyses on SQL/NoSQL Systems
 
Mapping Java Objects with JPA
Mapping Java Objects with JPAMapping Java Objects with JPA
Mapping Java Objects with JPA
 
Governing services, data, rules, processes and more
Governing services, data, rules, processes and moreGoverning services, data, rules, processes and more
Governing services, data, rules, processes and more
 
Waters North American Trading Architecture Summit April 2011
Waters North American Trading Architecture Summit April 2011Waters North American Trading Architecture Summit April 2011
Waters North American Trading Architecture Summit April 2011
 
PushToTest TestMaker 6.5 Open Source Test Design Document
PushToTest TestMaker 6.5 Open Source Test Design DocumentPushToTest TestMaker 6.5 Open Source Test Design Document
PushToTest TestMaker 6.5 Open Source Test Design Document
 
Open Source Test Workshop for CIOs, CTOs, Managers
Open Source Test Workshop for CIOs, CTOs, ManagersOpen Source Test Workshop for CIOs, CTOs, Managers
Open Source Test Workshop for CIOs, CTOs, Managers
 
Commercialization of OpenStack Object Storage
Commercialization of OpenStack Object StorageCommercialization of OpenStack Object Storage
Commercialization of OpenStack Object Storage
 
Monitoring is easy, why are we so bad at it presentation
Monitoring is easy, why are we so bad at it  presentationMonitoring is easy, why are we so bad at it  presentation
Monitoring is easy, why are we so bad at it presentation
 
Building Scalable Web Apps
Building Scalable Web AppsBuilding Scalable Web Apps
Building Scalable Web Apps
 

More from ikailan

Your language doesn't scale
Your language doesn't scaleYour language doesn't scale
Your language doesn't scale
ikailan
 
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
ikailan
 
2011 august-gdd-mexico-city-rest-json-oauth
2011 august-gdd-mexico-city-rest-json-oauth2011 august-gdd-mexico-city-rest-json-oauth
2011 august-gdd-mexico-city-rest-json-oauth
ikailan
 
2011 aug-gdd-mexico-city-high-replication-datastore
2011 aug-gdd-mexico-city-high-replication-datastore2011 aug-gdd-mexico-city-high-replication-datastore
2011 aug-gdd-mexico-city-high-replication-datastore
ikailan
 
2011 july-nyc-gtug-go
2011 july-nyc-gtug-go2011 july-nyc-gtug-go
2011 july-nyc-gtug-go
ikailan
 
2011 june-kuala-lumpur-gtug-hackathon
2011 june-kuala-lumpur-gtug-hackathon2011 june-kuala-lumpur-gtug-hackathon
2011 june-kuala-lumpur-gtug-hackathon
ikailan
 
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
ikailan
 
Introducing the App Engine datastore
Introducing the App Engine datastoreIntroducing the App Engine datastore
Introducing the App Engine datastore
ikailan
 
What is App Engine? O
What is App Engine? OWhat is App Engine? O
What is App Engine? Oikailan
 
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
ikailan
 
Boot camp 2010_app_engine_101
Boot camp 2010_app_engine_101Boot camp 2010_app_engine_101
Boot camp 2010_app_engine_101
ikailan
 
Building TweetEngine
Building TweetEngineBuilding TweetEngine
Building TweetEngineikailan
 

More from ikailan (12)

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 august-gdd-mexico-city-rest-json-oauth
2011 august-gdd-mexico-city-rest-json-oauth2011 august-gdd-mexico-city-rest-json-oauth
2011 august-gdd-mexico-city-rest-json-oauth
 
2011 aug-gdd-mexico-city-high-replication-datastore
2011 aug-gdd-mexico-city-high-replication-datastore2011 aug-gdd-mexico-city-high-replication-datastore
2011 aug-gdd-mexico-city-high-replication-datastore
 
2011 july-nyc-gtug-go
2011 july-nyc-gtug-go2011 july-nyc-gtug-go
2011 july-nyc-gtug-go
 
2011 june-kuala-lumpur-gtug-hackathon
2011 june-kuala-lumpur-gtug-hackathon2011 june-kuala-lumpur-gtug-hackathon
2011 june-kuala-lumpur-gtug-hackathon
 
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
 
What is App Engine? O
What is App Engine? OWhat is App Engine? O
What is App Engine? O
 
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
 
Boot camp 2010_app_engine_101
Boot camp 2010_app_engine_101Boot camp 2010_app_engine_101
Boot camp 2010_app_engine_101
 
Building TweetEngine
Building TweetEngineBuilding TweetEngine
Building TweetEngine
 

Recently uploaded

State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 

Recently uploaded (20)

State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 

2011 july-gtug-high-replication-datastore

  • 1. High Replication Datastore Ikai Lan plus.ikailan.com NYC GTUG July 27, 2011 Wednesday, July 27, 2011
  • 2. About the speaker • Ikai Lan • Developer Relations at Google based out of San Francisco, CA • Twitter: @ikai • Google+: plus.ikailan.com Wednesday, July 27, 2011
  • 3. Agenda • What is App Engine? • What is High Replication datastore? • Underneath the hood Wednesday, July 27, 2011
  • 4. What is App Engine? Wednesday, July 27, 2011
  • 5. Software Platform Infrastructure Source: Gartner AADI Summit Dec 2009 Wednesday, July 27, 2011
  • 6. Software Platform Infrastructure Source: Gartner AADI Summit Dec 2009 Wednesday, July 27, 2011
  • 7. Software Platform Infrastructure Source: Gartner AADI Summit Dec 2009 Wednesday, July 27, 2011
  • 8. Software Platform Infrastructure Source: Gartner AADI Summit Dec 2009 Wednesday, July 27, 2011
  • 9. SDK & “The Cloud” Hardware Networking Operating system Application runtime Java, Python, Go Static file serving Wednesday, July 27, 2011
  • 10. Scales dynamically App Server Wednesday, July 27, 2011
  • 11. Scales dynamically App Server App Server App Server Wednesday, July 27, 2011
  • 12. Customer: WebFilings Disruptive multi-tenant App Engine application adopted by Fortune 500 companies. Wednesday, July 27, 2011
  • 13. Customer: The Royal Wedding Peaked at 32,000 requests per second with no disruption! Wednesday, July 27, 2011
  • 14. >100K Developers >200K Apps >1.5B daily pageviews Wednesday, July 27, 2011
  • 15. App Engine Datastore Schemaless, non-relational datastore built on top of Google’s Bigtable technology Enables rapid development and scalability Wednesday, July 27, 2011
  • 16. High Replication • strongly consistent • multi datacenter • High reliability • consistent performance • no data loss Wednesday, July 27, 2011
  • 17. How do I use HR? • 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 Wednesday, July 27, 2011
  • 18. Strong vs. Eventual • Strong consistency means immediately after the datastore tells us the data has been committed, a subsequent read will return the data written • Eventual consistency means that some time after the datastore tells us data has been committed, a read will return written data - immediate read may or may not Wednesday, July 27, 2011
  • 19. 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); Wednesday, July 27, 2011
  • 20. 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); 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); Wednesday, July 27, 2011
  • 21. 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); Wednesday, July 27, 2011
  • 22. Why? • Reads are transactional • On a read, we try to determine if we have the latest version of some data • If not, we catch up the data on the node to the latest version Wednesday, July 27, 2011
  • 23. To understand this ... • We need some understanding of Paxos ... • ... which necessitates some understanding of transactions • ... which necessitates some understanding of entity groups Wednesday, July 27, 2011
  • 24. Entity Groups Entity User group root Blog Blog Entry Entry Entry Comment Comment Comment Wednesday, July 27, 2011
  • 25. Entity groups // 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); Wednesday, July 27, 2011
  • 26. Entity groups // 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); Wednesday, July 27, 2011
  • 27. Optimistic locking Client A reads Client B data. It's reads data. current It's current version is 11 version is 11 Modify data. Modify data. Increment version Increment version to 12 Datastore to 12 Client B tries Client ! tries to to save data. save data. Success! Datastore version is higher or equal than my version - FAIL Wednesday, July 27, 2011
  • 28. Transactional reads // 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); Wednesday, July 27, 2011
  • 29. Transactional reads Still being committed Blog Entry Version 11 Comment Comment Parent: Entry Parent: Entry Version 11 Version 12 Client B Client A reads Datastore transactionally data writing data Version 12 has not finished committing - Datastore returns version 11 Wednesday, July 27, 2011
  • 30. Paxos simplified Give me the newest data Node A Node B Datastore Client Is my data up to date? Node C Node D 1. If the data is up to date, return it 2. if the data is NOT up to date, "catch up" the data by applying the jobs in the journal and return the latest data Wednesday, July 27, 2011
  • 31. More reading • My example was grossly oversimplified • More details can be found here: http://www.cidrdb.org/cidr2011/Papers/ CIDR11_Paper32.pdf Wednesday, July 27, 2011
  • 32. 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 Wednesday, July 27, 2011
  • 33. Summary • Remember the rules of strong consistency and eventual consistency • Group your data into entity groups when possible and use ancestor queries Wednesday, July 27, 2011
  • 34. Questions? • Twitter: @ikai • Google+: plus.ikailan.com Wednesday, July 27, 2011