latjug. google app engine
DESCRIPTION
Java User Group Latvia February 2011 Google App Engine Valery Leushin http://goo.gl/rzD0qTRANSCRIPT
Google AppEngine
First experience
Java and Python on Google infrastructure
No need for own server, no electricity and ISP bills
Stable, cheap, scalable, fast to setup and easy to use
Administration, logs, statistics, all in one place
Greet and meet
• Take some war file and deploy it
Greet and meet
• Take some war file and deploy it• Discover that JDBC is blacklisted• Discover that actually a lot of stuff is blacklisted
Greet and meet
• Take some war file and deploy it• Discover that JDBC is blacklisted• Discover that actually a lot of stuff is blacklisted• Application instances are started on demand• Stopped after 2-3 minutes if not used• Url like: myapp.appspot.com• Only 10 applications per account
Startup time matters
• No activity = application stopped• First load = more time and resources
Datastore
• Upload 20 000 records in Datastore• Discover that data is wrong and you want to delete it• DELETE FROM ...
Datastore
• Upload 20 000 records in Datastore• Discover that data is wrong and you want to delete it• DELETE FROM ... oh, wait• GQL can only query for data• Create, update, delete only with code• Get used to it, write small utilities, agents
So, Datastore
• NoSQL, BigTable from Google
So, Datastore
• NoSQL, BigTable from Google• Because in most cases reads are often, writes are rare• Trade fast reads for slow writes
So, Datastore
• NoSQL, BigTable from Google• Because in most cases reads are often, writes are rare• Trade fast reads for slow writes• Denormalization is favored• Partial JPA and JDO support
So, Datastore
• NoSQL, BigTable from Google• Because in most cases reads are often, writes are rare• Trade fast reads for slow writes• Denormalization is favored• Partial JPA and JDO support• Record → Entity• Table → Kind• Column → Property• Entities of same kind can have different set of properties
No index = no query
• Each query has its own index
No index = no query
• Each query has its own index• Query without index = exception or empty result• Index must have all fields from "WHERE" clause• Even ASC and DESC order matter
Index takes space
• Example: 70MB of data
Index takes space
• Example: 70MB of data can have 300MB of indexes
Index takes space
• Example: 70MB of data can have 300MB of indexes• Do not index everything (to avoid situation above)• Index fields only used for queries• Reindex after index creation
Everything counts
• There is free quota
Everything counts
• There is free quota, which is good enough
Everything counts
• There is free quota, which is good enough• Use bulk operations
Getting used to limits
• 30 seconds per request• 1MB per request
Getting used to limits
• Currently:• 30 seconds per request• 10 minutes for TaskQueue/Cron requests• 10MB per request
Versions
• Multiple application versions at same time
Versions
• Multiple application versions at same time• One database though
Versions
• Multiple application versions at same time• One database though• Be careful• Useful in various ways• Easy switch
Services
• URLFetch• Memcache• TaskQueue• Mail• Images• Blobstore
OpenID
• Google Accounts by default• Possible Federated login
OpenID
• Google Accounts by default• Possible Federated login• @gmail.com• @hotmail.com• @yahoo.com• @yandex.ru• @rambler.ru
OpenID
• Google Accounts by default• Possible Federated login• @gmail.com• @hotmail.com• @yahoo.com• @yandex.ru• @rambler.ru• @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
• ...
Sometimes there is just bad weather
Pricing
• Resource-based• Free quota• Pay for surplus
Developing applications for AppEngine
Future of AppEngine
• Google AppEngine for Business
Demo
EveManagehttp://code.google.com/p/evemanage/
EveDbhttp://code.google.com/p/evedb/