SlideShare uma empresa Scribd logo
1 de 26
Baixar para ler offline
8                 build apps
                                     faster and
b                            intro
                                     easier


                              To
    >
                       Google                         K
5                    app engine                      developer
                                                    innovation


                          &
                      Appscale                            Z
                                         x
$             (                       deploy and
                                     scale on any
                                        cloud
                                                     rapid
                                                     releases
        Chris bunch
        chris@appscale.com
•   You have a cool idea

a                           •   To make it into an app, you
                                need to:
common •                          Setup hardware
pattern •                         Configure, deploy app
One of several recurring
problems seen in the real
                                  services

                            •
world today.
                                And you have to do this
                                for every app!
Why not Amazon?

•   You don’t want to deploy and maintain:

    •   Servers

    •   Load balancers

    •   App Servers

    •   Databases

•   And you don’t want to hire people to do it!

                                 www.appscale.com
                    Phone: +1(805) 845 0010 | e-mail: chris@appscale.com
                                                                           PAGE   3
google app engine

•   A web application hosting service

•   Never log into a server

•   Crystallizes web service best practices

•   Share common services between apps

•   Focus on writing your app

                          www.appscale.com
             Phone: +1(805) 845 0010 | e-mail: chris@appscale.com
                                                                    PAGE   4
Supported Languages




Python                                                          Java




                                Go

                      www.appscale.com
         Phone: +1(805) 845 0010 | e-mail: chris@appscale.com
                                                                       PAGE   5
Programming Model

Ñ   Everything is a web request


    Stateless, scalable web server, meaning:

(     •
      •
              No filesystem access
              Persistence via Datastore / memcache
      •       60 second time limit on requests
      •       APIs from whitelist only


                 www.appscale.com
    Phone: +1(805) 845 0010 | e-mail: chris@appscale.com
                                                           PAGE   6
The DATAstore

• Not a relational database, but resembles an
  object database
• You define Kinds of data you want to store
• Each object stored is an Entity
• Entities can be arranged into Groups
                           www.appscale.com
              Phone: +1(805) 845 0010 | e-mail: chris@appscale.com
                                                                     PAGE   7
Defining a kind

class Person(ndb.Model):

    user = ndb.UserProperty()

    balance = ndb.FloatProperty()

    phone = ndb.StringProperty()

    last_login = ndb.DateTimeProperty()




                     www.appscale.com
        Phone: +1(805) 845 0010 | e-mail: chris@appscale.com
                                                               PAGE   8
EXTENDING a kind

class Person(ndb.Model):

    user = ndb.UserProperty()

    balance = ndb.FloatProperty()

    phone = ndb.StringProperty()

    last_login = ndb.DateTimeProperty()

    login_location = ndb.GeoPt()



                     www.appscale.com
        Phone: +1(805) 845 0010 | e-mail: chris@appscale.com
                                                               PAGE   9
Kind, entities

class Person(ndb.Model):

         ...



new_person = Person()

new_person.put()




             www.appscale.com
Phone: +1(805) 845 0010 | e-mail: chris@appscale.com
                                                       PAGE   10
transactions
•   Updating an Entity happens in a Transaction

•   Apps tell App Engine which Entities will be updated together by putting
    them into an Entity Group

•   Transactions can only occur within an Entity Group*

                              def f():

                                 person = db.get(key1)

                                 person.balance = 100.00

                                 person.put()

                              db.run_in_transaction(f)


                                   www.appscale.com
                      Phone: +1(805) 845 0010 | e-mail: chris@appscale.com
                                                                             PAGE   11
memcache

data = memcache.get(‘key’)

if data:

   return data

else:

   data = db.get(‘key’)

   memcache.set(‘key’, data, 300)

   return data

             www.appscale.com
Phone: +1(805) 845 0010 | e-mail: chris@appscale.com
                                                       PAGE   12
users

user = users.get_current_user()

if user:

        return user.nickname()

else:

        return None




              www.appscale.com
 Phone: +1(805) 845 0010 | e-mail: chris@appscale.com
                                                        PAGE   13
mail

from = “Chris Bunch <chris@appscale.com>”

to= “You <foo@bar.com>”

subject = “Try out AppScale!”

body = “http://download.appscale.com”

mail.send_mail(sender=from, to=to, subject=subject,
body=body)




                           www.appscale.com
              Phone: +1(805) 845 0010 | e-mail: chris@appscale.com
                                                                     PAGE   14
task queue

taskqueue.add(url=“/path/to/worker”)


cron:
- description: sends friendly emails
  url: /path/to/worker
  schedule: every 24 hours




                     www.appscale.com
        Phone: +1(805) 845 0010 | e-mail: chris@appscale.com
                                                               PAGE   15
url fetch

r = urlfetch.fetch(“http://www.google.com/”)

if r.status_code == 200:

  do_something_with_result(r.content)

else:

   # retry later




                        www.appscale.com
           Phone: +1(805) 845 0010 | e-mail: chris@appscale.com
                                                                  PAGE   16
xmpp

user = “chris@appscale.com”

msg = “Hello there!”

status = xmpp.send_message(user, msg)

if status != xmpp.NO_ERROR:

    # decide what to do with the failed msg




                       www.appscale.com
          Phone: +1(805) 845 0010 | e-mail: chris@appscale.com
                                                                 PAGE   17
enter appscale

•   But what if you need:

    •   To fail over to a private cloud?

    •   To run your App Engine app in-house?

    •   To use APIs App Engine doesn’t support?

•   Then you need AppScale!


                            www.appscale.com
               Phone: +1(805) 845 0010 | e-mail: chris@appscale.com
                                                                      PAGE   18
run anywhere




             www.appscale.com
Phone: +1(805) 845 0010 | e-mail: chris@appscale.com
                                                       PAGE   19
datastore

•   Supports NoSQL datastores via a database
    agnostic API:

    •   get

    •   put

    •   range_query

    •   delete

                              www.appscale.com
                 Phone: +1(805) 845 0010 | e-mail: chris@appscale.com
                                                                        PAGE   20
we have supported




               www.appscale.com
  Phone: +1(805) 845 0010 | e-mail: chris@appscale.com
                                                         PAGE   21
now focusing on...




               www.appscale.com
  Phone: +1(805) 845 0010 | e-mail: chris@appscale.com
                                                         PAGE   22
load balancing + app servers




                     www.appscale.com
        Phone: +1(805) 845 0010 | e-mail: chris@appscale.com
                                                               PAGE   23
API Services




             www.appscale.com
Phone: +1(805) 845 0010 | e-mail: chris@appscale.com
                                                       PAGE   24
the development cycle

•   App Engine SDK for rapid development

•   Limitations:

    •   Many APIs are stubbed out (XMPP, Mail)

    •   Not designed for production workloads

•   Use AppScale!


                         www.appscale.com
            Phone: +1(805) 845 0010 | e-mail: chris@appscale.com
                                                                   PAGE   25
Demo

Mais conteúdo relacionado

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
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
Enterprise Knowledge
 

Último (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.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
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
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
 

Destaque

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Destaque (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Intro to App Engine and AppScale

  • 1. 8 build apps faster and b intro easier To > Google K 5 app engine developer innovation & Appscale Z x $ ( deploy and scale on any cloud rapid releases Chris bunch chris@appscale.com
  • 2. You have a cool idea a • To make it into an app, you need to: common • Setup hardware pattern • Configure, deploy app One of several recurring problems seen in the real services • world today. And you have to do this for every app!
  • 3. Why not Amazon? • You don’t want to deploy and maintain: • Servers • Load balancers • App Servers • Databases • And you don’t want to hire people to do it! www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 3
  • 4. google app engine • A web application hosting service • Never log into a server • Crystallizes web service best practices • Share common services between apps • Focus on writing your app www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 4
  • 5. Supported Languages Python Java Go www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 5
  • 6. Programming Model Ñ Everything is a web request Stateless, scalable web server, meaning: ( • • No filesystem access Persistence via Datastore / memcache • 60 second time limit on requests • APIs from whitelist only www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 6
  • 7. The DATAstore • Not a relational database, but resembles an object database • You define Kinds of data you want to store • Each object stored is an Entity • Entities can be arranged into Groups www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 7
  • 8. Defining a kind class Person(ndb.Model): user = ndb.UserProperty() balance = ndb.FloatProperty() phone = ndb.StringProperty() last_login = ndb.DateTimeProperty() www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 8
  • 9. EXTENDING a kind class Person(ndb.Model): user = ndb.UserProperty() balance = ndb.FloatProperty() phone = ndb.StringProperty() last_login = ndb.DateTimeProperty() login_location = ndb.GeoPt() www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 9
  • 10. Kind, entities class Person(ndb.Model): ... new_person = Person() new_person.put() www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 10
  • 11. transactions • Updating an Entity happens in a Transaction • Apps tell App Engine which Entities will be updated together by putting them into an Entity Group • Transactions can only occur within an Entity Group* def f(): person = db.get(key1) person.balance = 100.00 person.put() db.run_in_transaction(f) www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 11
  • 12. memcache data = memcache.get(‘key’) if data: return data else: data = db.get(‘key’) memcache.set(‘key’, data, 300) return data www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 12
  • 13. users user = users.get_current_user() if user: return user.nickname() else: return None www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 13
  • 14. mail from = “Chris Bunch <chris@appscale.com>” to= “You <foo@bar.com>” subject = “Try out AppScale!” body = “http://download.appscale.com” mail.send_mail(sender=from, to=to, subject=subject, body=body) www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 14
  • 15. task queue taskqueue.add(url=“/path/to/worker”) cron: - description: sends friendly emails url: /path/to/worker schedule: every 24 hours www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 15
  • 16. url fetch r = urlfetch.fetch(“http://www.google.com/”) if r.status_code == 200: do_something_with_result(r.content) else: # retry later www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 16
  • 17. xmpp user = “chris@appscale.com” msg = “Hello there!” status = xmpp.send_message(user, msg) if status != xmpp.NO_ERROR: # decide what to do with the failed msg www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 17
  • 18. enter appscale • But what if you need: • To fail over to a private cloud? • To run your App Engine app in-house? • To use APIs App Engine doesn’t support? • Then you need AppScale! www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 18
  • 19. run anywhere www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 19
  • 20. datastore • Supports NoSQL datastores via a database agnostic API: • get • put • range_query • delete www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 20
  • 21. we have supported www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 21
  • 22. now focusing on... www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 22
  • 23. load balancing + app servers www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 23
  • 24. API Services www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 24
  • 25. the development cycle • App Engine SDK for rapid development • Limitations: • Many APIs are stubbed out (XMPP, Mail) • Not designed for production workloads • Use AppScale! www.appscale.com Phone: +1(805) 845 0010 | e-mail: chris@appscale.com PAGE 25
  • 26. Demo