Pika Cluster Horizontal Scaling: Unlimited Performance

Background Pika is a persistent large-capacity redis storage service, compatible with most of the interfaces of string, hash, list, zset, and set (compatibility details), and solves the capacity bottleneck of redis that is insufficient due to the huge amount of stored data. Users can migrate from redis to pika service without modifying any code. It has good compatibility… Read More »

SOLID principles: Introduction, Best Practices, and Interview Questions and answers

SOLID principle introduction Following practical and clear design principles is conducive to flexible and reliable software design. SOLID is an acronym for the five essential principles of object-oriented design. When we design classes and modules, following the SOLID principles can make the software more robust and stable. Q1: What are the SOLID principles? S – Single responsibility principle… Read More »

Use R2DBC with MySQL database

Introduction R2DBC is an asynchronous, non-blocking relational database connection specification. Although some NoSQL database vendors provide reactive database clients for their databases, for most projects, migrating to NoSQL is not an ideal choice. This prompted the birth of a universal, responsive relational database connection specification. As a relational database with a huge user base, MySQL also has a… Read More »

Best practices of implementing pagination for one-to-many results in SQL

Introduction One-to-many results paging is a prevalent scenario, for example, we want to query the product and product picture information. But many people will encounter the misunderstanding of paging here and get incorrect results. Come to analyze and solve this problem today. Problem analysis Let’s first create a simple commodity table and the corresponding commodity picture relationship table.… Read More »

How to avoid double payments and ensure idempotency in a distributed web application with Spring Boot

Idempotency Idempotency means that no matter how many times you execute the request, the result is the same. Speaking of idempotency, you have to say repeated submission. You click the submit button continuously. In theory, this is the same piece of data. The database should only store one item but store multiple items, which violates idempotency. Therefore, we… Read More »

How to set up a cron job in Django using django-crontab

Why do we use scheduled tasks For the static homepage, considering that the data of the page may be maintained by multiple operating personnel and changes frequently, it is made into a scheduled task, that is, the static is performed regularly Performing scheduled tasks in Django can be achieved through the django-crontab extension. Installation Configure installed applications Add… Read More »

Configuring HugePages on Linux

In virtual paging storage, the virtual storage space and physical main storage space are divided into pages of fixed size, and the memory allocation for threads is also in units of pages. For example, if the page size is 4K, 4GB/4KB=1M records are needed for 4GB storage space, that is, there are more than 1 million 4KB pages.… Read More »

TOP 10 JVM Garbage Collection Interview Questions

Questions: Describe the Java garbage collection mechanism. What is GC? Why do we use GC? Advantages and principles of garbage collection, and describe two recovery mechanisms. What is the basic principle of the garbage collector? Can the garbage collector reclaim memory immediately? What’s the way to actively notify the virtual machine for garbage collection? What are the reference… Read More »

Heartbeat animation using HTML and CSS

We can create a simple heartbeat animation using HTML and CSS without much coding. The only thing we need to do is to add a box and use CSS to display it. First, add a visual box to the page Then, make a heart-shape box Finally, set up the animation. It’s worth noticing that the animation must be… Read More »

Step by step implementation of the AdaBoost model

When we make a decision every day, we often consult several people and comprehensively adopt their opinions. So is it possible to copy this idea into the field of machine learning and create multiple models to synthesize the results? Synthesizing is, of course, viable, and this idea is called the ensemble method. Ensemble method The ensemble method itself… Read More »

Best practices of using the Thunk in JavaScript

The evaluation strategy of a compiler is usually divided into pass-by-call and pass-by-call. Thunk functions are implemented by pass-by-call by the compiler. They often put parameters into a temporary function and then put This temporary function is passed into the function body. This temporary function is called the Thunk function. Evaluation strategy Compiler evaluation strategies are usually divided… Read More »