Book Image

Hands-On Microservices with Django

By : Tieme Woldman
Book Image

Hands-On Microservices with Django

By: Tieme Woldman

Overview of this book

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.
Table of Contents (18 chapters)
Free Chapter
1
Part 1:Introducing Microservices and Getting Started
5
Part 2:Building the Microservices Foundation
11
Part 3:Taking Microservices to the Production Level

Improving Microservices Performance with Caching

Because microservices run asynchronously, their execution time and performance are of minor importance in most scenarios. For example, when a Django web app offloads the task of sending a confirmation email to the user, it doesn’t matter whether the email arrives in 5 or 15 seconds. Nevertheless, we developers want to utilize resources optimally, and in extreme cases, we can end up with microservices taking half an hour or longer to run.

To address this, this chapter teaches you how to maintain and improve microservices performance with caching. First, you’ll learn about the fundamentals and benefits of caching. Then, you’ll learn about applying Django’s cache framework. Finally, you’ll master Redis for caching.

By the end of this chapter, you will know how to apply caching in Django microservices applications to maintain or improve performance.

To achieve this, this chapter covers the following...