Stateless Services
· β˜• 3 min read
1. Problem Description Background: a SaaS application developed with Django, offering document services externally. Its search feature is implemented through Django Haystack. Problem: the search feature is sometimes available and sometimes not. After repeated testing, the available and unavailable states were found to alternate, each occurring with a probability of

Content-Type in the HTTP Header
· β˜• 5 min read
1. HTTP Header The HTTP protocol is an application-layer specification built on top of TCP/IP, transmitted as ASCII text. The HTTP specification divides an HTTP request into three parts: the status line, the request headers, and the message body. Something like this: 1 2 3 4 5 <method><request-URL><version> <headers> <entity-body> An HTTP header falls into four categories: general headers, request headers, response headers, and entity headers.

Python's Class Function Methods
· β˜• 3 min read
1. Function Methods A function is an organized, reusable snippet of code used to implement a single or related piece of functionality. Functions improve an application’s modularity and the reuse rate of code. Python provides many built-in functions, such as print() and str(). At the same time, Python also allows

Interactive Notebook - Jupyter
· β˜• 2 min read
1. Introduction Jupyter Notebook (formerly IPython notebook) is an interactive notebook that supports running more than 40 programming languages. Jupyter Notebook is in fact a web application that lets you create and share program documents, with support for live code, mathematical equations, visualizations, and Markdown. Its uses include data cleaning

RabbitMQ Message Queue
· β˜• 3 min read
1. Where a Message Queue Fits 1.1 Asynchronous Processing Use case: after a user registers, a registration email and a registration SMS must be sent. With the synchronous approach, system performance (concurrency, throughput, response time) hits a bottleneck. 1.2 Application Decoupling Use case: after a user places an order, the