Woldman Tieme / Вольдман Тиме - Hands-On Microservices with Django / Практические микросервисы с Django [2024, PDF/EPUB, ENG]

Страницы:  1
Ответить
 

tsurijin

Стаж: 3 года 6 месяцев

Сообщений: 1638


tsurijin · 07-Май-24 05:12 (16 дней назад)

Hands-On Microservices with Django: Build cloud-native and reactive applications with Python using Django 5 / Практические микросервисы с Django: Создание облачных и реактивных приложений на Python с использованием Django 5
Год издания: 2024
Автор: Woldman Tieme / Вольдман Тиме
Издательство: Packt Publishing
ISBN: 978-1-83546-852-4
Язык: Английский
Формат: PDF, EPUB
Качество: Издательский макет или текст (eBook)
Интерактивное оглавление: Да
Количество страниц: 278
Описание: Unlock the potential of microservices architecture and master the art of building scalable and resilient web applications using Django
Key Features
Deliver, optimize, and secure high-performing microservices in Django
Apply community-standard components for microservices like DRF (RESTful APIs), Celery, RabbitMQ, Redis, and Django’s Cache Framework
Transform existing monolithic applications into microservices
Book Description
Are you a Django developer looking to leverage microservices to create optimized and scalable web applications? If yes, then this book is for you. With microservices, you can split an application into self-contained services, each with a specific scope running asynchronously while collectively executing processes. Written by an experienced Python developer, Hands-On Microservices with Django teaches you how to develop and deploy microservices using Django and accompanying components such as Celery and Redis.
You’ll start by learning the principles of microservices and message/task queues and how to design them effectively. Next, you’ll focus on building your first microservices with Django RESTful APIs (DFR) and RabbitMQ, mastering the fundamentals along the way. As you progress, you’ll get to grips with dockerizing your microservices. Later, you’ll discover how to optimize and secure them for production environments.
By the end of this book, you’ll have the skills you need to design and develop production-ready Django microservices applications with DFR, Celery/RabbitMQ, Redis, and Django’s cache framework.
What you will learn
Understand the architecture of microservices and how Django implements it
Build microservices that leverage community-standard components such as Celery, RabbitMQ, and Redis
Test microservices and deploy them with Docker
Enhance the security of your microservices for production readiness
Boost microservice performance through caching
Implement best practices to design and deploy high-performing microservices
Who this book is for
This microservices and Django book is for Django developers who want to take the next step in back-end application development by adopting cloud-native microservices. Backend developers with working knowledge of Flask or other Python programming web frameworks will also benefit from this book. Basic knowledge of developing web APIs will help you get started with quickly building microservices on your own.
Раскройте потенциал архитектуры микросервисов и овладейте искусством создания масштабируемых и устойчивых веб-приложений с использованием Django
Kлючевые функции
Предоставляйте, оптимизируйте и защищайте высокопроизводительные микросервисы в Django
Применяйте стандартные компоненты сообщества для микросервисов, таких как DRF (RESTful API), Celery, RabbitMQ, Redis и фреймворк кэширования Django
Преобразуйте существующие монолитные приложения в микросервисы
Описание книги
Вы разработчик на Django и хотите использовать микросервисы для создания оптимизированных и масштабируемых веб-приложений? Если да, то эта книга для вас. С помощью микросервисов вы можете разделить приложение на автономные службы, каждая из которых имеет определенную область действия и работает асинхронно, одновременно совместно выполняя процессы. Книга "Практические микросервисы на Django", написанная опытным разработчиком на Python, научит вас разрабатывать и развертывать микросервисы с использованием Django и сопутствующих компонентов, таких как Celery и Redis.
Вы начнете с изучения принципов работы микросервисов и очередей сообщений/задач, а также с того, как эффективно их проектировать. Далее вы сосредоточитесь на создании своих первых микросервисов с использованием Django RESTful API (DFR) и RabbitMQ, попутно осваивая основы. По мере продвижения вы научитесь настраивать свои микросервисы. Позже вы узнаете, как оптимизировать и обезопасить их для производственных сред.
К концу прочтения этой книги вы овладеете навыками, необходимыми для проектирования и разработки готовых к работе приложений Django для микросервисов с использованием DFR, Celery/RabbitMQ, Redis и фреймворка кэширования Django.
Что вы узнаете
Разбирайтесь в архитектуре микросервисов и в том, как она реализована в Django
Создавайте микросервисы, использующие стандартные компоненты сообщества, такие как Celery, RabbitMQ и Redis
Тестируйте микросервисы и развертывайте их с помощью Docker
Повышайте безопасность ваших микросервисов для обеспечения их готовности к работе
Повышайте производительность микросервисов за счет кэширования
Внедрять передовые методы проектирования и развертывания высокопроизводительных микросервисов
Для кого предназначена эта книга
Эта книга о микросервисах и Django предназначена для разработчиков Django, которые хотят сделать следующий шаг в разработке серверных приложений, внедрив облачные микросервисы. Эта книга также пригодится разработчикам серверной части, которые на практике знакомы с Flask или другими веб-платформами для программирования на Python. Базовые знания о разработке веб-API помогут вам быстро приступить к самостоятельному созданию микросервисов.
Примеры страниц (скриншоты)
Оглавление
Prefacexiii
Part 1: Introducing Microservices and Getting Started
1
What Is a Microservice? 3
Comparing monolithic web applications and microservices 4
A monolithic version of a Discount Claim app 4
A microservices version of the Discount Claim app 6
Characteristics of microservices 7
Exploring the microservices architecture and its components 8
An analogy to deepen our understanding of microservices10
Listing the benefits of microservices 11
The drawbacks of microservices 12
Distinguishing types of microservice 12
Cloud-native microservices 12
Reactive microservices 14
Designing microservices 15
Analyzing the user story 15
Split the user story into use cases 16
Summary19
2
Introducing the Django Microservices Architecture 21
Technical requirements 21
Exploring Django’s native components for microservices web applications 22
DRF22
Django’s Cache Framework 24
Traversing the external components for Django microservices web applications28
Task and message queue brokers 28
Container software 30
The complete Django microservices
architecture 31
Creating a sample microservice 31
Implementation 1: Offloading a task with
a RabbitMQ microservice 33
Implementation 2: Offloading a task with
a Celery microservice 39
Summary 43
3
Setting Up the Development and Runtime Environment 45
Technical requirements 45
Setting up the development
environment 46
Extra setup for Windows developers 46
Installing the required Python packages 49
Setting up the runtime environment 51
Installing Docker Desktop 52
Installing RabbitMQ as a Docker container 53
Installing Redis as a Docker container 54
Signing up for MongoDB and working from
VS Code 54
Analyzing the sample microservices
application 56
Matching an address 56
The app’s requirements as user stories 57
Splitting the requirements into use cases 59
Phasing the development of the sample
application 61
Summary 61
Part 2: Building the Microservices Foundation
4
Cloud-native Data Processing with MongoDB 65
Technical requirements 66
Introducing MongoDB and
cloud-native databases 66
What are cloud-native databases? 66
MongoDB is a NoSQL database 67
Setting up MongoDB 69
Optional: creating a paid cluster for
production databases 70
Creating a database user 70
Setting up our MongoDB cluster for Django 71
Creating a Database 72
Creating documents inside a collection 72
Updating documents 73
Deleting documents and collections 73
Mapping CRUD operations to
HTTP methods 74
CRUD operations on MongoDB with
Django ORM 75
CRUD operations on MongoDB with pymongo 81
Cleaning up 84
Summary 84
5
Creating RESTful APIs for Microservices 85
Technical requirements 86
Introducing RESTful APIs 86
Benefits of RESTful APIs 88
The RESTful API architecture 88
Building RESTful APIs with DRF 90
Setting up DRF 92
Creating a model and a serializer 93
Creating a view and the URL endpoints 94
Browsing a DRF RESTful API 106
Error handling 108
Handling wrong-formatted requests 108
Handling validation errors 109
Summary 110
6
Orchestrating Microservices with Celery and RabbitMQ 111
Technical requirements 112
Introducing task queues 112
Implementing the work queue scenario 113
Implementing the Publish-Subscribe scenario 116
Implementing the Request-Response scenario 119
Exploring Celery and RabbitMQ 123
Celery 124
RabbitMQ 125
Creating and running
asynchronous tasks 127
Creating and running a Celery-based task 128
Creating and running a RabbitMQ-based task 141
Monitoring tasks and task queues 147
Monitoring Celery tasks with Flower 147
Monitoring RabbitMQ tasks 148
Summary 149
7
Testing Microservices 151
Technical requirements 152
Introducing testing microservices 152
Unit testing microservices 154
Creating and running happy path tests 155
Creating and running boundary tests 160
End-to-end testing microservices 163
Automated testing with Selenium 166
Summary 169
8
Deploying Microservices with Docker 171
Technical requirements 172
Introducing Docker 172
Benefits of Docker (containers) 173
Containerizing microservices 173
Applying multi-container
deployment with Docker Compose 177
Deploying a Django microservices
application 180
Showing a list of the images we created 181
Showing a list of created and running
containers 181
Inspecting the console output of a container 182
Stopping a container 182
Starting a container 183
Removing a container 183
Removing an image 183
Deploying a new microservices version 184
Scaling microservices 185
Vertical and horizontal scaling 185
Docker Swarm 187
Kubernetes 187
Summary 188
Part 3: Taking Microservices to the
Production Level
9
Securing Microservices 191
Technical requirements 192
Introducing microservices security 192
North-south security for microservices 192
East-west security for microservices 194
Token-based security with JWT 195
User-based security with OAuth 2.0 196
Controlling access to microservices 196
Securing data communication
between microservices 202
Summary 204
10
Improving Microservices Performance with Caching 205
Technical requirements 206
Introducing caching 206
Applying Django’s cache framework 208
Caching a web page 210
Caching page data 212
Using Redis for caching 215
Redis as a backend cache for Django’s cache
framework 215
Redis as a standalone cache 216
Summary 219
11
Best Practices for Microservices 221
Technical requirements 221
Organizing code 222
Apply the singe task principle 222
Separate responsibilities 222
Standardize the communication protocols 223
Containerize microservices 223
Apply version control 224
Document the code 224
Conduct code reviews 224
Documenting microservices 225
Provide code comments 225
Create a README file for the
microservices application 226
Document RESTful APIs 227
Logging and monitoring 227
Apply integrated logging 228
Implement log levels 229
Log context information 229
Alert anomalies 230
Error handling 230
Catch and log errors 230
Other error handling options 231
Versioning microservices 232
Apply semantic versioning 232
Utilize RESTful API versioning 233
Summary 233
Further reading 234
12
Transforming a Monolithic Web Application into
a Microservices Version 235
Introducing the transformation
approach 236
Implementing the approach step
by step 236
Determining requirements 237
Decomposing the monolith 238
Designing the microservices 241
Selecting the technology 242
Creating the data foundation 243
Developing the microservices 244
Testing and deploying 245
Summary 246
Index 247
Other Books You May Enjoy 256
Download
Rutracker.org не распространяет и не хранит электронные версии произведений, а лишь предоставляет доступ к создаваемому пользователями каталогу ссылок на торрент-файлы, которые содержат только списки хеш-сумм
Как скачивать? (для скачивания .torrent файлов необходима регистрация)
[Профиль]  [ЛС] 
 
Ответить
Loading...
Error