更新时间:2021-07-02 18:54:49
coverpage
Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Why subscribe?
Customer Feedback
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
Understanding Microservices
Origins of Service-Oriented Architecture
The monolithic approach
The microservice approach
Microservice benefits
Separation of concerns
Smaller projects
Scaling and deployment
Microservices pitfalls
Illogical splitting
More network interactions
Data storing and sharing
Compatibility issues
Testing
Implementing microservices with Python
The WSGI standard
Greenlet and Gevent
Twisted and Tornado
asyncio
Language performances
Summary
Discovering Flask
Which Python?
How Flask handles requests
Routing
Variables and converters
The url_for function
Request
Response
Flask built-in features
The session object
Globals
Signals
Extensions and middlewares
Templates
Configuration
Blueprints
Error handling and debugging
Custom error handler
The debug mode
A microservice skeleton
Coding Testing and Documenting - the Virtuous Cycle
Different kinds of tests
Unit tests
Functional tests
Integration tests
Load tests
End-to-end tests
Using WebTest
Using pytest and Tox
Developer documentation
Continuous Integration
Travis-CI
ReadTheDocs
Coveralls
Designing Runnerly
The Runnerly application
User stories
Monolithic design
Model
View and Template
Background tasks
Strava token
Authentication and authorization
Putting together the monolithic design
Splitting the monolith
Data Service
Using Open API 2.0
More splitting
Interacting with Other Services
Synchronous calls
Using Session in a Flask app
Connection pooling
HTTP cache headers
Improving data transfer
GZIP compression
Binary payloads
Putting it together