2. What is App Engine?
• Run your web applications on Google’s
infrastructure
• PaaS = Platform as a Service
• Automatic scaling
• Need to comply to platform’s rules
• Application is sandboxed
• Production environment simulated by SDK
• Python, Java, and other JVM languages
• Supports most web frameworks
3. What are the rules?
• Read-only filesystem
• 30s time to respond
• No socket connections
• No processes or threads
• No system calls
• Limit on number and size of files
• Quotas on system resources
4. Everything through API
• URL Fetch
• Mail
• Images
• Google Accounts
• CRON
• Task Queues
• XMPP (Jabber)
• Memcached
5. Google Datastore
• Distributed database
• Base on BigTable
• Supports transactions and partitioning
• Supports hierarchies
• Not a relational database
• No schema
• No SQL
6. Datastore principle
• Primary building block: Entity
• All entities stored in one “table”
• Each entity has it’s Kind
• instead of being in a separate table
• Entity’s key is unique across Kind’s
• Entity Groups - hierarchical structures
• Entity has 0..N Properties
7. Vlastnosti Entit
• Each Entity can have any combination of
attributes.
• Two entites of the same kind can have different properties
• Multivalue properties are supported (ie. Array)
• this can be used for 1:N and M:N relations
• Each entity can have it’s parrent
• It’s possible to construct hierarchical structures
• Hierarchies are used for automatic partitioning of the database
• Transactions are possible only across Entity Group members
8. Datastore limitations
• Not using SQL, only GQL (Python) or JDOQL (Java)
• No joins support, not even anything similar
• No database constraints
• No aggregation functions (count, avg, min, max…)
• Maximum of 1000 records from one query. It’s not possible to go over
this limitation using offset, but cursors support is planned.
• Inequality filter on one property only
SELECT * FROM Person WHERE
birth_year >= 1980 AND birth_year <= 2009
SELECT * FROM Person WHERE
birth_year >= 1980 AND height >= 180
• No global transactions - only inside Entity Group
• No ad-hoc query support. Each type of query needs to have it’s own
index configured. SDK does this automatically.
9. How to cope with this?
• Consider suitability of the platform
• Is it even possible to implement my project?
• Change mindset
• Change the way application is designed
• Forget relational database stereotypes
• Exploit Datastore’
• Simplicity, speed, versatility, multivalue attributes…
• Denormalize!
• Transfer the data consistence responsibility from
database to application
13. Conclusion
• App Engine easy development of
scalable web applications
• Be careful of specific limitations
• Suitable for very small or very large
projects
• It’s getting better every day