售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Mastering Google App Engine
Table of Contents
Mastering Google App Engine
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Understanding the Runtime Environment
The overall architecture
The challenge of scale
How to scale with the scale?
Scaling in practice
Infrastructure as a Service
Platform as a Service
Containers
How does App Engine scales?
Available runtimes
Python
The Java runtime environment
Go
PHP
The structure of an application
The available services
Datastore
Google Cloud SQL
The Blobstore
Memcache
Scheduled Tasks
Queues Tasks
MapReduce
XMPP
Channels
Users
OAuth
Writing and deploying a simple application
Installing an SDK on Linux
Installing an SDK on Mac
Installing an SDK on Windows
Writing a simple app
Deploying
Summary
2. Handling Web Requests
Request handling
The CGI program
Streams and environment variables
CGI and Google App Engine
WSGI
Problems with CGI
Solutions
What WSGI looks like
WSGI – Multithreading considerations
WSGI in Google App Engine
Request handling in App Engine
Rendering templates
Serving static resources
Cache, headers, and mime types
Serving files
Using web frameworks
Built-in frameworks
Using external frameworks
Using Bottle
Summary
3. Understanding the Datastore
The BigTable
The data model
How is data stored?
The physical storage
Some limitations
Random writes and deletion
Operations on BigTable
Reading
Writing
Deleting
Updating
Scanning a range
Selecting a key
BigTable – a hands-on approach
Scaling BigTable to BigData
The datastore thyself
Supporting queries
Data as stored in BigTable
The implementation details
Summary
4. Modeling Your Data
The data modeling language
Keys and internal storage
The application ID
Namespaces
The Kind
The ID
Pre-allocating numeric IDs
The string ID
The key
Modeling your data
The first approach – storing a reference as a property
The second approach – a category within a key
Properties
The required option
The default option
The repeated option
The choices options
The indexed option
The validator option
The available properties
Structured Properties
The computed properties
The model
The constructor
Class methods
The allocate_ids() method
The get_by_id() method
The get_or_insert() method
The query() method
The instance methods
The populate() method
The put() method
The to_dict() method
Asynchronous versions
Model hooks
Summary
5. Queries, Indexes, and Transactions
Querying your data
Queries under the hood
Single-property queries
Examples of single-property queries
Multiple property indexes
Working with indexes
The query API
The Query object
App
Namespace
Kind
The ancestor
The projection
Filters
The orders
Further query options
The keys_only function
The projection
The offset
The limit
The batch_size entities
The prefetch_size entities
The produce_cursors entities
The start_cursor entities
The end_cursor entities
Filtering entities
Filtering repeated properties
Filtering structured properties
The AND and OR operations
Iterating over the results
Conclusions
Transactions
Summary
6. Integrating Search
Background
The underlying principle
Indexing your data
Sample data
Indexing thyself
Documents
Fields
The text fields
Placing the document in an index
Getting a document
Updating documents
Deleting documents
Indexing the documents
Queries
Simple queries
Multiple value queries
Logical operations
Being specific with fields
Operators on NumberField
Operators on DateField
Operations on AtomField
Operations on TextField and HTMLField
Operations on GeoField
Putting it all together
Selecting fields and calculated fields
Sorting
Pagination
Offset-based pagination
Cursor-based pagination
Facets
Indexing facets
Fetching facets
Asking facets via automatic discovery
Asking specific facets
Asking facets with specific values
Asking facets in specific ranges
Filtering by facets
Summary
7. Using Task Queues
The need to queue things
The queue
Defining queues
Adding to a queue
Processing tasks
Putting it all together
Using a deferred library
Pull queues
Summary
8. Reaching out, Sending E-mails
About e-mails
Sending e-mails
The object-oriented API
E-mail on the development console
Headers
Receiving e-mails
Handling bounce notifications
Putting it all together
Summary
9. Working with the Google App Engine Services
Memcache
The Memcache operations
Memcache in Google App Engine
The Memcache client
The object-oriented client
Multi-tenancy
Automatically setting the namespace
The API-specific notes
The Datastore
Memcache
Task queues
Search
Blobstore
Blobs
Uploads
Getting BlobInfo
More BlobInfo methods
Serving
Reading
Users
Storing users in datastore
Images
Putting it all together
Summary
10. Application Deployment
Deployment configurations
Deployment revisited
Versions
The instance classes
Instance addressability
Scaling types
Manual scaling
Basic scaling
Automatic scaling
Modules
Accessing the modules
The dispatch.yaml file
Scheduled tasks
The Scheduled tasks format
Protecting cron handling URLs
Logs
The Remote API
AppStats
Summary
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜