latjug. google app engine

40
Google AppEngine First experience

Upload: denis-udod

Post on 01-Nov-2014

777 views

Category:

Technology


0 download

DESCRIPTION

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

TRANSCRIPT

Page 1: LatJUG. Google App Engine

Google AppEngine

First experience

Page 2: LatJUG. Google App Engine

Java and Python on Google infrastructure

Page 3: LatJUG. Google App Engine

No need for own server, no electricity and ISP bills

  

Page 4: LatJUG. Google App Engine

Stable, cheap, scalable, fast to setup and easy to use

 

Page 5: LatJUG. Google App Engine

Administration, logs, statistics, all in one place

 

Page 6: LatJUG. Google App Engine

Greet and meet

• Take some war file and deploy it

Page 7: LatJUG. Google App Engine

Greet and meet

• Take some war file and deploy it• Discover that JDBC is blacklisted• Discover that actually a lot of stuff is blacklisted

Page 8: LatJUG. Google App Engine

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

Page 9: LatJUG. Google App Engine

Startup time matters

• No activity = application stopped• First load = more time and resources

Page 10: LatJUG. Google App Engine

Datastore

• Upload 20 000 records in Datastore• Discover that data is wrong and you want to delete it• DELETE FROM ...

Page 11: LatJUG. Google App Engine

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

Page 12: LatJUG. Google App Engine

So, Datastore

• NoSQL, BigTable from Google

 

Page 13: LatJUG. Google App Engine

So, Datastore

• NoSQL, BigTable from Google• Because in most cases reads are often, writes are rare• Trade fast reads for slow writes

 

Page 14: LatJUG. Google App Engine

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

 

Page 15: LatJUG. Google App Engine

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

 

Page 16: LatJUG. Google App Engine

No index = no query

• Each query has its own index

Page 17: LatJUG. Google App Engine

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

Page 18: LatJUG. Google App Engine

Index takes space

• Example: 70MB of data

Page 19: LatJUG. Google App Engine

Index takes space

• Example: 70MB of data can have 300MB of indexes

Page 20: LatJUG. Google App Engine

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

Page 21: LatJUG. Google App Engine

Everything counts

• There is free quota

Page 22: LatJUG. Google App Engine

Everything counts

• There is free quota, which is good enough

Page 23: LatJUG. Google App Engine

Everything counts

• There is free quota, which is good enough• Use bulk operations

Page 24: LatJUG. Google App Engine

Getting used to limits

• 30 seconds per request• 1MB per request

Page 25: LatJUG. Google App Engine

Getting used to limits

• Currently:• 30 seconds per request• 10 minutes for TaskQueue/Cron requests• 10MB per request

Page 26: LatJUG. Google App Engine

Versions

• Multiple application versions at same time

Page 27: LatJUG. Google App Engine

Versions

• Multiple application versions at same time• One database though

Page 28: LatJUG. Google App Engine

Versions

• Multiple application versions at same time• One database though• Be careful• Useful in various ways• Easy switch

Page 29: LatJUG. Google App Engine

Services

• URLFetch• Memcache• TaskQueue• Mail• Images• Blobstore

Page 30: LatJUG. Google App Engine

OpenID

• Google Accounts by default• Possible Federated login

Page 31: LatJUG. Google App Engine

OpenID

• Google Accounts by default• Possible Federated login• @gmail.com• @hotmail.com• @yahoo.com• @yandex.ru• @rambler.ru

Page 32: LatJUG. Google App Engine

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

• ...

Page 33: LatJUG. Google App Engine

Sometimes there is just bad weather

 

Page 34: LatJUG. Google App Engine

 

 

Page 35: LatJUG. Google App Engine
Page 36: LatJUG. Google App Engine

Pricing

• Resource-based• Free quota• Pay for surplus

Page 37: LatJUG. Google App Engine

Developing applications for AppEngine

 

Page 38: LatJUG. Google App Engine

Future of AppEngine

• Google AppEngine for Business

Page 39: LatJUG. Google App Engine

 

 

Page 40: LatJUG. Google App Engine

Demo

EveManagehttp://code.google.com/p/evemanage/

EveDbhttp://code.google.com/p/evedb/