Google App Engine for Java v0.0.2

1,234 views

Published on

Google App Engine 3 hour workshop for Java developers presented at GIDS 2010 in Bangalore, India

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

No Downloads
Views
Total views
1,234
On SlideShare
0
From Embeds
0
Number of Embeds
17
Actions
Shares
0
Downloads
0
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Google App Engine for Java v0.0.2

  1. 1. Google App Engine a JVM cloud computing workshop by Matthew McCullough, Ambient Ideas, LLC
  2. 2. Matthew McCullough ★ Open Source Architect Ambient Ideas, LLC ★ Twitter @matthewmccull ★ Email matthewm@ambientideas.com ★ Web ambientideas.com/blog
  3. 3. 90 min 90 min
  4. 4. on ? Le ss sto ry H i
  5. 5. v elo pe rs! We ’re De
  6. 6. Let’s build an app!
  7. 7. Google App Engine SDK
  8. 8. Google Web Toolkit SDK
  9. 9. Google Eclipse Plugin
  10. 10. Let’s code!
  11. 11. deploy to local development server
  12. 12. debugging defaults
  13. 13. Success!
  14. 14. Why the cloud?
  15. 15. I have an idea for an app!
  16. 16. scrounge up money
  17. 17. LD SO
  18. 18. going great, then...
  19. 19. Spiked Traffic
  20. 20. D LD LO S OS
  21. 21. Whew! We survived!
  22. 22. Not again!
  23. 23. D LD LD LO O S OS S
  24. 24. can’t afford to keep doing this!
  25. 25. success = crowds
  26. 26. crowds can be good
  27. 27. crowds can be bad
  28. 28. crowds are sudden
  29. 29. crowds are transient
  30. 30. fu nds! No Re
  31. 31. pay-per-use!
  32. 32. brilliant!
  33. 33. GAE Account
  34. 34. before a real deployment
  35. 35. sign up for GAE
  36. 36. http://appengine.google.com
  37. 37. Google account
  38. 38. SMS-delivered code
  39. 39. demo of signup
  40. 40. Production Deployment
  41. 41. reserve App ID
  42. 42. http://appengine.google.com Control Panel
  43. 43. demo reserving App ID
  44. 44. set App ID & Version
  45. 45. demo setting App ID
  46. 46. deploy...
  47. 47. demo deploying to production GAE from eclipse
  48. 48. <appid>.appspot.com
  49. 49. Pay-as-you-go?
  50. 50. who thought of this?
  51. 51. Joh nM cCa r thy
  52. 52. 1960
  53. 53. 1960
  54. 54. 1960
  55. 55. “com putation may someday d as a publ ic utility” be organize -John McCarthy
  56. 56. with the premise that the data services and “It starts be on servers. We c all it cloud computing architecture should be in a cloud somewhere.” – they should -Eric Schmidt, 8/9/2006
  57. 57. what does this solve?
  58. 58. New Signups Active Users Users Jan Feb Mar Apr May Jun Jul Aug Sep
  59. 59. minimal cost for short-lived peaks
  60. 60. Command Line (SDK)
  61. 61. appcfg.sh appcfg.cmd
  62. 62. production maintenance
  63. 63. > appcfg.sh help Action must be one of: help: Print help for a specific action. request_logs: Write request logs in Apache common log format. rollback: Rollback an in-progress update. update: Create or update an app version. update_indexes: Update application indexes. update_cron: Update application cron jobs. update_queues: Update application task queue definitions. update_dos: Update application DoS protection configuration. version: Prints version information. cron_info: Displays times for the next several runs of each cron job. Use 'help <action>' for a detailed description.
  64. 64. demo appcfg help
  65. 65. push to production
  66. 66. appcfg.sh update war
  67. 67. fetch logs
  68. 68. appcfg.sh request_logs war mylogs.log
  69. 69. demo appcfg fetch logs
  70. 70. dev_appserver.sh dev_appserver.cmd
  71. 71. Jetty Servlet Container
  72. 72. demo dev_appserver
  73. 73. The WAR
  74. 74. WAR folder format
  75. 75. no actual WAR
  76. 76. optimized to upload delta
  77. 77. Logging
  78. 78. log4j
  79. 79. java.util.logging
  80. 80. System.out == info System.err == warning
  81. 81. The Datastore
  82. 82. A place to store data
  83. 83. Filesystem
  84. 84. Relational database
  85. 85. column-oriented
  86. 86. List ( Maps ( Maps ) )
  87. 87. schema-less
  88. 88. Persisting Easily ★ Low Level Datastore API ★ com.google.appengine.api.datastore
  89. 89. low level API
  90. 90. full control but... vendor lock in
  91. 91. DataNucleus
  92. 92. Who?
  93. 93. DataNucleus
  94. 94. JDO
  95. 95. JPA
  96. 96. demo JDO persistence
  97. 97. demo two rows with columns differing
  98. 98. Why Google’s cloud?
  99. 99. free to start
  100. 100. generous free quotas
  101. 101. no hardware to own
  102. 102. no OS to patch
  103. 103. no network to secure
  104. 104. SaaS PaaS IaaS
  105. 105. Python + JVM languages
  106. 106. Java Runtime 1.6
  107. 107. Jetty servlet container
  108. 108. Google uptime
  109. 109. Google scaling brilliance
  110. 110. freedom through constraints
  111. 111. freedom through constra ints
  112. 112. The Whitelist
  113. 113. the allowed classes
  114. 114. Banned ⅘ Java
  115. 115. The JRE Class White List A Java App Engine application's access to the classes in the Java standard library (the Java Runtime Environment, or JRE) is limited to the following classes: java.awt.datatransfer.DataFlavor java.awt.datatransfer.MimeType java.awt.datatransfer.Transferable java.beans.AppletInitializer java.beans.BeanDescriptor java.beans.BeanInfo java.beans.Beans java.beans.ConstructorProperties java.beans.Customizer java.beans.DefaultPersistenceDelegate java.beans.DesignMode java.beans.Encoder java.beans.EnumPersistenceDelegate java.beans.EventHandler java.beans.EventSetDescriptor java.beans.ExceptionListener java.beans.FeatureDescriptor java.beans.IndexedPropertyChangeEvent java.beans.IndexedPropertyDescriptor java.beans.IntrospectionException java.beans.Introspector java.beans.MethodDescriptor java.beans.ParameterDescriptor java.beans.PersistenceDelegate java.beans.PropertyChangeEvent java.beans.PropertyChangeListener
  116. 116. org.xml.sax.DocumentHandler org.xml.sax.EntityResolver org.xml.sax.ErrorHandler org.xml.sax.HandlerBase org.xml.sax.InputSource org.xml.sax.Locator org.xml.sax.Parser org.xml.sax.SAXException org.xml.sax.SAXNotRecognizedException org.xml.sax.SAXNotSupportedException org.xml.sax.SAXParseException org.xml.sax.XMLFilter org.xml.sax.XMLReader org.xml.sax.ext.Attributes2 org.xml.sax.ext.Attributes2Impl org.xml.sax.ext.DeclHandler org.xml.sax.ext.DefaultHandler2 org.xml.sax.ext.EntityResolver2 org.xml.sax.ext.LexicalHandler org.xml.sax.ext.Locator2 org.xml.sax.ext.Locator2Impl org.xml.sax.helpers.AttributeListImpl org.xml.sax.helpers.AttributesImpl org.xml.sax.helpers.DefaultHandler org.xml.sax.helpers.LocatorImpl org.xml.sax.helpers.NamespaceSupport org.xml.sax.helpers.ParserAdapter org.xml.sax.helpers.ParserFactory org.xml.sax.helpers.XMLFilterImpl org.xml.sax.helpers.XMLReaderAdapter org.xml.sax.helpers.XMLReaderFactory
  117. 117. controversial
  118. 118. you agree with Sun policing it or not, “Whether all very well for Java compatib ility has served us over a decade. es being sure as a d eveloper that all That includ ll platforms. core classes a re present on a -sets of the cor e classes in the Creating sub tform was forb idden for a really Java pla nd irresponsible to good reaso n, and it's wanton a casually flaunt the rules.” s -Simon Phipps, OSS Manager, Sun Microsystem
  119. 119. what about J2ME?
  120. 120. No threads
  121. 121. No File I/O
  122. 122. No Sockets
  123. 123. No JNI
  124. 124. demo violating the whitelist locally
  125. 125. demo violating the whitelist remotely
  126. 126. Why another vendor’s cloud?
  127. 127. better response times
  128. 128. 3000 ‘hello world’ 2250 GAE response times in milliseconds 1500 750
  129. 129. OS neutrality
  130. 130. choice of programming language
  131. 131. avoiding G AE platform l ock-in
  132. 132. EC2
  133. 133. SimpleDB
  134. 134. S3 Storage
  135. 135. CloudServers
  136. 136. Windows OS
  137. 137. Linux OS
  138. 138. CDN
  139. 139. open networking
  140. 140. root access
  141. 141. 1.5 cents/hour
  142. 142. 0.66 rupees/hour
  143. 143. Dashboard
  144. 144. web console
  145. 145. logging
  146. 146. datastore inspector
  147. 147. usage graphs
  148. 148. Memcache
  149. 149. retrieve, but don’t calculate
  150. 150. why the 2nd data source?
  151. 151. tested, measured, proven
  152. 152. JSR-107 / JCache
  153. 153. demo memcache
  154. 154. Mail
  155. 155. email services
  156. 156. common for web apps
  157. 157. realiable delivery
  158. 158. URL Fetch
  159. 159. only means of port connectivity
  160. 160. 10 second limit
  161. 161. 10 MB request limit
  162. 162. demo URLFetch
  163. 163. demo fail on 10MB get
  164. 164. Task Queue
  165. 165. webhook pattern
  166. 166. outbound = API
  167. 167. inbound = HTTP POST
  168. 168. scheduled
  169. 169. queues
  170. 170. worker, processing
  171. 171. but still limited to 30 seconds
  172. 172. Quotas
  173. 173. why?
  174. 174. multi-tenancy
  175. 175. cumulative
  176. 176. per day
  177. 177. per minute
  178. 178. 30 seconds max per request
  179. 179. demo quota limit grid
  180. 180. profiling usage
  181. 181. demo quota code
  182. 182. demo app stats
  183. 183. Costs
  184. 184. very affordable
  185. 185. great for startups
  186. 186. great for weekend experiments
  187. 187. demo cost grid
  188. 188. Security
  189. 189. helped by constraints
  190. 190. built-in authentication
  191. 191. developer roles
  192. 192. web.xml
  193. 193. demo security config
  194. 194. spring security (formerly acegi)
  195. 195. Co-Developers
  196. 196. dev invite process
  197. 197. https:// only for appspot domains
  198. 198. Domain Names
  199. 199. CNAME entries
  200. 200. Real World Comparisons
  201. 201. Limits too tight?
  202. 202. Blobs > 50MB?
  203. 203. Throughput > 72GB / day?
  204. 204. Throughput > 1TB / day?
  205. 205. Transactions > 43,000,000 / day?
  206. 206. Blob Store
  207. 207. images, zips, audio
  208. 208. Datastore, 1 MB limit
  209. 209. 50MB max
  210. 210. XMPP
  211. 211. Jabber, Google Talk, Google Wave
  212. 212. instant message service
  213. 213. why in a GAE app?
  214. 214. webhook pattern
  215. 215. demo XMPP console, API
  216. 216. Image Manipulation
  217. 217. convenience functions
  218. 218. AWT on blacklist
  219. 219. Secure Data Connector
  220. 220. Enterprise
  221. 221. Concerns
  222. 222. p s ck u ba
  223. 223. no binary solution
  224. 224. csv export
  225. 225. Resources
  226. 226. Official Blog
  227. 227. App Gallery
  228. 228. http://vancouver2010.crosspollinate.org/search
  229. 229. Issue Tracker
  230. 230. Datastore Archive Feature Request
  231. 231. Maven Support Feature Request
  232. 232. The takeaways
  233. 233. What is the single biggest benefit of GAE? Scalability
  234. 234. What type of business best fits GAE? Startups
  235. 235. What types of apps best fit GAE? Web Mashups
  236. 236. What is the hardest limit of GAE to work around? 30 sec. processing
  237. 237. Google App Engine a JVM cloud computing workshop att end ing! you for Th ank by Matthew McCullough, Ambient Ideas, LLC
  238. 238. Resources SDK Downloads: http://code.google.com/appengine/downloads.html App Gallery: http://appgallery.appspot.com/ Issue Tracker: http://code.google.com/p/googleappengine/issues/list Secure Data Connector Install: http://code.google.com/securedataconnector/docs/1.0/installing.html
  239. 239. Photo Credits Various Clouds: http://www.ambientideasphotography.com Newspaper: http://www.flickr.com/photos/12836528@N00/1202823367 Flickr Chart: http://www.flickr.com/photos/85494010@N00/84912961 No Refunds: http://www.flickr.com/photos/8804814@N08/2591957763 Cell Phone Number Pad: http://www.flickr.com/photos/88543347@N00/2243527026 Men Conversation: http://www.flickr.com/photos/99037763@N00/2314463032 Backup Tape: http://www.flickr.com/photos/48615294@N00/75622824
  240. 240. Photo Credits Clouds: http://www.flickr.com/photos/cindy47452/1624383308/ Big Chair: http://www.flickr.com/photos/annapickard/20988642/sizes/o/ Yellow Crowd: http://www.flickr.com/photos/twose/887903401/sizes/l/ Multicolor Crowd: http://www.flickr.com/photos/akc77/3370167184/sizes/l/ Jet Truck: http://www.flickr.com/photos/85819182@N00/301495633 Puzzled Power Plug: http://www.flickr.com/photos/95492938@N00/3203311346 Power Towers: http://www.flickr.com/photos/97544179@N00/3317530283 Reporter: http://www.flickr.com/photos/19953384@N00/4101633839 Idea Lightbulb Head: http://www.flickr.com/photos/17731548@N00/981372736

×