Python Microservices Development

A practical approach to conquering the complexities of Microservices using the Python tooling ecosystem

Python Microservices Development

This ebook is included in a Mapt subscription
Tarek Ziadé

1 customer reviews
A practical approach to conquering the complexities of Microservices using the Python tooling ecosystem
$0.00
$25.20
$44.99
$29.99p/m after trial
RRP $35.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781785881114
Paperback340 pages

Book Description

We often deploy our web applications into the cloud, and our code needs to interact with many third-party services. An efficient way to build applications to do this is through microservices architecture. But, in practice, it's hard to get this right due to the complexity of all the pieces interacting with each other.

This book will teach you how to overcome these issues and craft applications that are built as small standard units, using all the proven best practices and avoiding the usual traps. It's a practical book: you’ll build everything using Python 3 and its amazing tooling ecosystem. You will understand the principles of TDD and apply them.

You will use Flask, Tox, and other tools to build your services using best practices. You will learn how to secure connections between services, and how to script Nginx using Lua to build web application firewall features such as rate limiting. You will also familiarize yourself with Docker’s role in microservices, and use Docker containers, CoreOS, and Amazon Web Services to deploy your services.

This book will take you on a journey, ending with the creation of a complete Python application based on microservices. By the end of the book, you will be well versed with the fundamentals of building, designing, testing, and deploying your Python microservices.

Table of Contents

Chapter 1: Understanding Microservices
Origins of Service-Oriented Architecture
The monolithic approach
The microservice approach
Microservice benefits
Microservices pitfalls
Implementing microservices with Python
Summary
Chapter 2: Discovering Flask
Which Python?
How Flask handles requests
Flask built-in features
A microservice skeleton
Summary
Chapter 3: Coding, Testing, and Documenting - the Virtuous Cycle
Different kinds of tests
Using WebTest
Using pytest and Tox
Developer documentation
Continuous Integration
Summary
Chapter 4: Designing Runnerly
The Runnerly application
Monolithic design
Splitting the monolith
Data Service
Using Open API 2.0
More splitting
Summary
Chapter 5: Interacting with Other Services
Synchronous calls
Asynchronous calls
Testing
Summary
Chapter 6: Monitoring Your Services
Centralizing logs
Performance metrics
Summary
Chapter 7: Securing Your Services
The OAuth2 protocol
Token-based authentication
Web application firewall
Securing your code
Chapter 8: Bringing It All Together
Building a ReactJS dashboard
ReactJS and Flask
Authentication and authorization
Chapter 9: Packaging and Running Runnerly
The packaging toolchain
Running all microservices
Process management
Summary
Chapter 10: Containerized Services
What is Docker?
Docker 101
Running Flask in Docker
The full stack - OpenResty, Circus and Flask
Docker-based deployments
Summary
Chapter 11: Deploying on AWS
AWS overview
Routing - Route53, ELB, and AutoScaling
Execution - EC2 and Lambda
Storage - EBS, S3, RDS, ElasticCache, and CloudFront
Deploying on AWS - the basics
Deploying with ECS
Route53
Summary
Chapter 12: What Next?
Iterators and generators
Coroutines
The asyncio library
The aiohttp framework
Sanic
Asynchronous versus synchronous

What You Will Learn

  • Explore what microservices are and how to design them
  • Use Python 3, Flask, Tox, and other tools to build your services using best practices
  • Learn how to use a TDD approach
  • Discover how to document your microservices
  • Configure and package your code in the best way
  • Interact with other services
  • Secure, monitor, and scale your services
  • Deploy your services in Docker containers, CoreOS, and Amazon Web Services

Authors

Table of Contents

Chapter 1: Understanding Microservices
Origins of Service-Oriented Architecture
The monolithic approach
The microservice approach
Microservice benefits
Microservices pitfalls
Implementing microservices with Python
Summary
Chapter 2: Discovering Flask
Which Python?
How Flask handles requests
Flask built-in features
A microservice skeleton
Summary
Chapter 3: Coding, Testing, and Documenting - the Virtuous Cycle
Different kinds of tests
Using WebTest
Using pytest and Tox
Developer documentation
Continuous Integration
Summary
Chapter 4: Designing Runnerly
The Runnerly application
Monolithic design
Splitting the monolith
Data Service
Using Open API 2.0
More splitting
Summary
Chapter 5: Interacting with Other Services
Synchronous calls
Asynchronous calls
Testing
Summary
Chapter 6: Monitoring Your Services
Centralizing logs
Performance metrics
Summary
Chapter 7: Securing Your Services
The OAuth2 protocol
Token-based authentication
Web application firewall
Securing your code
Chapter 8: Bringing It All Together
Building a ReactJS dashboard
ReactJS and Flask
Authentication and authorization
Chapter 9: Packaging and Running Runnerly
The packaging toolchain
Running all microservices
Process management
Summary
Chapter 10: Containerized Services
What is Docker?
Docker 101
Running Flask in Docker
The full stack - OpenResty, Circus and Flask
Docker-based deployments
Summary
Chapter 11: Deploying on AWS
AWS overview
Routing - Route53, ELB, and AutoScaling
Execution - EC2 and Lambda
Storage - EBS, S3, RDS, ElasticCache, and CloudFront
Deploying on AWS - the basics
Deploying with ECS
Route53
Summary
Chapter 12: What Next?
Iterators and generators
Coroutines
The asyncio library
The aiohttp framework
Sanic
Asynchronous versus synchronous

Book Details

ISBN 139781785881114
Paperback340 pages
Read More
From 1 reviews

Read More Reviews