Google app engine - Soft Uni 19.06.2014

907 views
833 views

Published on

Запис от лекцията в Софтуерният Университет.

Говорихме си какво е Cloud, кои са по - популярните публични клайдове и как все един от тях е решил да предоставя облачни услуги като след това преминахме към основната тема Google App Engine.

Published in: Software, Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
907
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Google app engine - Soft Uni 19.06.2014

  1. 1. App Engine Getting started for ... Java Developers @d_danailov
  2. 2. Google App Engine Dimitar Danailov Senior Developer at 158ltd.com dimityr.danailov[at]gmail.com Slideshare.net Github YouTube Founder at VarnaIT Google App Engine - Online Demos Github Code
  3. 3. Topics Today ● Cloud Computing ● What is Google App Engine(GAE) ? ● Architecture of GAE ● Quota & Pricing ● Developing using GAE ● Deploying Applications ● Security ● GAE datastore ● Demo Application
  4. 4. Cloud computing
  5. 5. Classification of cloud computing
  6. 6. What is Google App Engine(GAE) ? ● Google’s platform to build Web Applications on the cloud ● Dynamic Web server ● Transactional Data Store Model
  7. 7. Why GAE? ● Automatic scaling and load balancing ● Lower total cost of ownership ● Web administration console & utilities ● Enhances developing & deploying of web applications ● Multilanguage support (Java, Python, GO, PHP) ● Fully featured SDK for local development ● Rich set of Google APIs ● Secure environment (Sandbox)
  8. 8. What is Google App Engine(GAE) ?
  9. 9. Quota & Pricing ● Google App Engine Pricing ● Google Compute Engine ● Google Cloud Storage ● Google BigQuery ● Google Cloud SQL
  10. 10. Application life Cycle
  11. 11. Application Development using GAE
  12. 12. Development life Cycle
  13. 13. Your first GAE Application ● Hello, World
  14. 14. GAE Services ● Developers are focused on implementing custom business logic ● Wide range of services available ○ User service ○ Blobstore ○ Task Queues ○ Mail Service ○ Image ○ Memcache, etc
  15. 15. User Services ● Provides a simple API for authentication and authorization ○ Detect if a user is signed in App ○ Detect if a user is an admin ● Works in combination with web.xml security settings ● Three authentication options ○ Google Account ○ Google Apps domains users ○ OpenID - experimental
  16. 16. User Services Demo
  17. 17. Blobstore Services ● The Blobstore Service allows your application to serve binary objects, larger than the entities in the Datastore. ● Blobs are created by uploading files through HTTP ○ The upload and store logic is handled by the Service ○ The HTTP request is redirected to a dispatcher, by specified by the developer
  18. 18. Blobstore Services Demo
  19. 19. Task Queues ● Task Queues allow the application to perform work, initiated by a user request, outside of that request. ● Suitable for triggering background processes ● Different types of queues ○ Push queues ○ Pull queues ○ REST reference
  20. 20. Task Queues Demo
  21. 21. Storing Data ● GAE provides different ways of storing application data ○ Datastore - provides a noSQL schemaless object datastore with a query engine and transactions ○ Google Cloud SQL - provides a relation database, based on MySQL ○ Google Cloud Storage - provides a storage service for objects and files up to terabytes in size
  22. 22. SQL vs NoSQL : Battle of Backends
  23. 23. Datastore ● Based on Google Big Table ● NoSQL object storage ● Schemaless and Hierarchical ● No joins and aggregations ● Queries must rung against existing indexes ● Access API using an instance of the DatastoreService Class
  24. 24. Datastore - Types ● There are two different Datastore types we can use : ○ High Replication Datastore(HRD) ○ Master / Slave Datastore
  25. 25. Datastore - Types (HRD) ● High Replication Datastore(HRD) is replicated across multiple data centers ○ Highest level of availability ○ Higher latency on writes ○ Query data is eventually consistent
  26. 26. Datastore - Types (Master/Slave) ● Master / Slave Datastore - one data center holds master copy of the data. Data in the master is asynchronously copied to the slaves. ○ Periods of unavailability ○ Low latency ○ Highest level on consistency
  27. 27. Datastore - Entities ● Entities - contain key/value pairs ● Each entity has a unique key comprised of : ○ The kind of the entity (Example : Person, Human) ○ An identifier for the the individual entity that can be ■ a key name string ■ an integer numeric ID ○ An optional ancestor path locating the entity in the Datastore hierarchy
  28. 28. Datastore - Entities (2) ● The Entity class ● Creating an Entity ○ Create an instance of the Entity class ○ pass it to the DatastoreService.put() method ● Retrieving an Entity ○ Pass an entity Key to the DatastoreService.get()
  29. 29. Datastore - Entities (3) ● Updating an Entity ○ No different between creating and updating ● Deleting an Entity ○ Pass an entity Key to the DatastoreService.delete() method
  30. 30. Datastore Entities Demo
  31. 31. Datastore - Queries ● Queries retrieve a number of entities that meet a specified set of conditions from Datastore ● Queries can specify : ○ Entity kind ○ Zero or more filters, based on entity properties values ○ Zero or more sort order descriptions ○ Default or you can set a limit clause ● Rung against an existing index
  32. 32. Datastore - Queries (2) ● The Query Class ○ Pass entity kind as constructor parameter ● Adding filters - Datastore Filter Class and setFilter method ○ Property name ○ Operator - a value, defined in FilterOperator ○ Value - the value to compare to ● Sorting - addsort() method ○ Property name ○ Sort order - a value, defined in SortDirection
  33. 33. Datastore - Queries (3) ● Fetching results ○ Pass a Query instance to the DatastoreService. prepare() method ○ Use one of the methods of the PreparedQuery instance, returned as a result ○ Refine your results using FetchOptions
  34. 34. Datastore - Indexes ● Similar to relational database indexes ● Automatic indexed created for some queries ● Other queries require indexes to be manually created in the datastore-indexes.xml. They include : ○ Queries with multiple sort orders ○ Queries with a sort order on keys in descending order ○ Queries with one or more inequality filters on a property and one or more equality filters on other properties, etc.
  35. 35. Queries Demo
  36. 36. Datastore - Transactions ● Transactions - a set of atomic operations ● Transaction type : ○ Default transactions - work on a single entity ○ Cross - group (XG) transactions - work on different entity groups ● Getting a Transaction instance - DatastoreService. beginTransaction()
  37. 37. Datastore - Transactions (2) ● Manipulating a transaction ○ Transaction.commit() - confirm changes ○ Transaction.rollback - rollback changes, restore previous state
  38. 38. Datastore Transactions Demo
  39. 39. Source ● https://cloud.google.com ● http://upload.wikimedia.org ● http://en.wikipedia.org ● http://stackoverflow.com/ ● https://www.youtube.com
  40. 40. Questions ? Dimitar Danailov Senior Developer at 158ltd.com dimityr.danailov[at]gmail.com Slideshare.net Github YouTube Founder at VarnaIT Google App Engine - Online Demos Github Code

×