LatJUG. Google App Engine

758 views

Published on

Java User Group Latvia
February 2011
Google App Engine
Valery Leushin
http://goo.gl/rzD0q

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

  • Be the first to like this

No Downloads
Views
Total views
758
On SlideShare
0
From Embeds
0
Number of Embeds
78
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

LatJUG. Google App Engine

  1. 1. Google AppEngine First experience
  2. 2. Java and Python on Google infrastructure
  3. 3. No need for own server, no electricity and ISP bills <ul><li>   </li></ul>
  4. 4. Stable, cheap, scalable, fast to setup and easy to use <ul><li>  </li></ul>
  5. 5. Administration, logs, statistics, all in one place <ul><li>  </li></ul>
  6. 6. Greet and meet <ul><ul><li>Take some war file and deploy it </li></ul></ul>
  7. 7. Greet and meet <ul><ul><li>Take some war file and deploy it </li></ul></ul><ul><ul><li>Discover that JDBC is blacklisted </li></ul></ul><ul><ul><li>Discover that actually a lot of stuff is blacklisted </li></ul></ul>
  8. 8. Greet and meet <ul><ul><li>Take some war file and deploy it </li></ul></ul><ul><ul><li>Discover that JDBC is blacklisted </li></ul></ul><ul><ul><li>Discover that actually a lot of stuff is blacklisted </li></ul></ul><ul><ul><li>Application instances are started on demand </li></ul></ul><ul><ul><li>Stopped after 2-3 minutes if not used </li></ul></ul><ul><ul><li>Url like: myapp.appspot.com </li></ul></ul><ul><ul><li>Only 10 applications per account </li></ul></ul>
  9. 9. Startup time matters <ul><ul><li>No activity = application stopped </li></ul></ul><ul><ul><li>First load = more time and resources </li></ul></ul>
  10. 10. Datastore <ul><ul><li>Upload 20 000 records in Datastore </li></ul></ul><ul><ul><li>Discover that data is wrong and you want to delete it </li></ul></ul><ul><ul><li>DELETE FROM ... </li></ul></ul>
  11. 11. Datastore <ul><ul><li>Upload 20 000 records in Datastore </li></ul></ul><ul><ul><li>Discover that data is wrong and you want to delete it </li></ul></ul><ul><ul><li>DELETE FROM ... oh, wait </li></ul></ul><ul><ul><li>GQL can only query for data </li></ul></ul><ul><ul><li>Create, update, delete only with code </li></ul></ul><ul><ul><li>Get used to it, write small utilities, agents </li></ul></ul>
  12. 12. So, Datastore <ul><ul><li>NoSQL, BigTable from Google </li></ul></ul><ul><li>  </li></ul>
  13. 13. So, Datastore <ul><ul><li>NoSQL, BigTable from Google </li></ul></ul><ul><ul><li>Because in most cases reads are often, writes are rare </li></ul></ul><ul><ul><li>Trade fast reads for slow writes </li></ul></ul><ul><li>  </li></ul>
  14. 14. So, Datastore <ul><ul><li>NoSQL, BigTable from Google </li></ul></ul><ul><ul><li>Because in most cases reads are often, writes are rare </li></ul></ul><ul><ul><li>Trade fast reads for slow writes </li></ul></ul><ul><ul><li>Denormalization is favored </li></ul></ul><ul><ul><li>Partial JPA and JDO support </li></ul></ul><ul><li>  </li></ul>
  15. 15. So, Datastore <ul><ul><li>NoSQL, BigTable from Google </li></ul></ul><ul><ul><li>Because in most cases reads are often, writes are rare </li></ul></ul><ul><ul><li>Trade fast reads for slow writes </li></ul></ul><ul><ul><li>Denormalization is favored </li></ul></ul><ul><ul><li>Partial JPA and JDO support </li></ul></ul><ul><ul><li>Record -> Entity </li></ul></ul><ul><ul><li>Table -> Kind </li></ul></ul><ul><ul><li>Column -> Property </li></ul></ul><ul><ul><li>Entities of same kind can have different set of properties </li></ul></ul><ul><li>  </li></ul>
  16. 16. No index = no query <ul><ul><li>Each query has its own index </li></ul></ul>
  17. 17. No index = no query <ul><ul><li>Each query has its own index </li></ul></ul><ul><ul><li>Query without index = exception or empty result </li></ul></ul><ul><ul><li>Index must have all fields from &quot;WHERE&quot; clause </li></ul></ul><ul><ul><li>Even ASC and DESC order matter </li></ul></ul>
  18. 18. Index takes space <ul><ul><li>Example: 70MB of data </li></ul></ul>
  19. 19. Index takes space <ul><ul><li>Example: 70MB of data can have 300MB of indexes </li></ul></ul>
  20. 20. Index takes space <ul><ul><li>Example: 70MB of data can have 300MB of indexes </li></ul></ul><ul><ul><li>Do not index everything (to avoid situation above) </li></ul></ul><ul><ul><li>Index fields only used for queries </li></ul></ul><ul><ul><li>Reindex after index creation </li></ul></ul>
  21. 21. Everything counts <ul><ul><li>There is free quota </li></ul></ul>
  22. 22. Everything counts <ul><ul><li>There is free quota, which is good enough </li></ul></ul>
  23. 23. Everything counts <ul><ul><li>There is free quota, which is good enough </li></ul></ul><ul><ul><li>Use bulk operations </li></ul></ul>
  24. 24. Getting used to limits <ul><ul><li>30 seconds per request </li></ul></ul><ul><ul><li>1MB per request </li></ul></ul>
  25. 25. Getting used to limits <ul><ul><li>Currently: </li></ul></ul><ul><ul><li>30 seconds per request </li></ul></ul><ul><ul><li>10 minutes for TaskQueue/Cron requests </li></ul></ul><ul><ul><li>10MB per request </li></ul></ul>
  26. 26. Versions <ul><ul><li>Multiple application versions at same time </li></ul></ul>
  27. 27. Versions <ul><ul><li>Multiple application versions at same time </li></ul></ul><ul><ul><li>One database though </li></ul></ul>
  28. 28. Versions <ul><ul><li>Multiple application versions at same time </li></ul></ul><ul><ul><li>One database though </li></ul></ul><ul><ul><li>Be careful </li></ul></ul><ul><ul><li>Useful in various ways </li></ul></ul><ul><ul><li>Easy switch </li></ul></ul>
  29. 29. Services <ul><ul><li>URLFetch </li></ul></ul><ul><ul><li>Memcache </li></ul></ul><ul><ul><li>TaskQueue </li></ul></ul><ul><ul><li>Mail </li></ul></ul><ul><ul><li>Images </li></ul></ul><ul><ul><li>Blobstore </li></ul></ul>
  30. 30. OpenID <ul><ul><li>Google Accounts by default </li></ul></ul><ul><ul><li>Possible Federated login </li></ul></ul>
  31. 31. OpenID <ul><ul><li>Google Accounts by default </li></ul></ul><ul><ul><li>Possible Federated login </li></ul></ul><ul><ul><li>@gmail.com </li></ul></ul><ul><ul><li>@hotmail.com </li></ul></ul><ul><ul><li>@yahoo.com </li></ul></ul><ul><ul><li>@yandex.ru </li></ul></ul><ul><ul><li>@rambler.ru </li></ul></ul>
  32. 32. OpenID <ul><ul><li>Google Accounts by default </li></ul></ul><ul><ul><li>Possible Federated login </li></ul></ul><ul><ul><li>@gmail.com </li></ul></ul><ul><ul><li>@hotmail.com </li></ul></ul><ul><ul><li>@yahoo.com </li></ul></ul><ul><ul><li>@yandex.ru </li></ul></ul><ul><ul><li>@rambler.ru </li></ul></ul><ul><ul><li>@mail.ru, @live.co.uk @a42.ru, @bk.ru, @schuett-nms.de, @partreg.lg.ua, @neglect.us, @saikonet.org, @clear.net.nz, @meta.ua, @gmx.de, @mchsi.com, @tut.by, @pp.inet.fi </li></ul></ul><ul><ul><li>... </li></ul></ul>
  33. 33. Sometimes there is just bad weather <ul><li>  </li></ul>
  34. 34.   <ul><li>  </li></ul>
  35. 36. Pricing <ul><ul><li>Resource-based </li></ul></ul><ul><ul><li>Free quota </li></ul></ul><ul><ul><li>Pay for surplus </li></ul></ul>
  36. 37. Developing applications for AppEngine <ul><li>  </li></ul>
  37. 38. Future of AppEngine <ul><ul><li>Google AppEngine for Business </li></ul></ul>
  38. 39.   <ul><li>  </li></ul>
  39. 40. Demo <ul><li>EveManage </li></ul><ul><li>http://code.google.com/p/evemanage/ </li></ul><ul><li>EveDb </li></ul><ul><li>http://code.google.com/p/evedb/ </li></ul>

×