Setting Up MySQL Master-Master Replication in Docker Containers
This guide assumes familiarity with basic MySQL replication concepts and focuses exclusively on configuring a master-master replication setup using Docker containers. For master-slave replication, refer to other resources.
Understanding Master-Master Replication
In traditional master-slave replication, writes are restricted to the master to avo ...
Posted on Tue, 21 Jul 2026 16:28:44 +0000 by pluginbaby
Handling Multiple Parameter Types in MyBatis Mapper Methods
MyBatis supports various ways to pass parameters to mapper methods, depending on the type and number of arguments. Below are common scenarios with corresponding interface definitions, XML mappings, and usage patterns.
Mapper Interface
package com.msb.mapper;
import com.msb.pojo.Emp;
import org.apache.ibatis.annotations.Param;
import java.util. ...
Posted on Mon, 20 Jul 2026 17:37:26 +0000 by bnmng
Essential MySQL Commands Reference
1.1 Database and Table Operations
Data Definition Language is used for defining database structures
1.1.1 Database Operations
Display all databases: SHOW DATABASES;
Display database creation details: SHOW CREATE DATABASE database_name;
Create a database: CREATE DATABASE database_name;
Create database with existence check: CREATE DATABASE IF NO ...
Posted on Mon, 20 Jul 2026 16:42:45 +0000 by ibechane
Recovering a Corrupted SYSTEM Datafile Header Using BBED
This document outlines the procedure for recovering a corrupted SYSTEM datafile header using the Oracle BBED utility.
1. Initial Diagnostics and Trace Analysis
Begin by starting the database in MOUNT mode and enabling SQL trace to capture diagnostic information during the OPEN attempt. This will help identify which datafiles and blocks are bein ...
Posted on Sat, 18 Jul 2026 16:53:17 +0000 by master123467
Implementing JDBC with Spring Framework
Implementing JDBC with Spring Framework
Creating a database table for student records:
CREATE DATABASE STUDENT;
USE STUDENT;
CREATE TABLE STUDENT(
ID INT PRIMARY KEY AUTO_INCREMENT,
NAME VARCHAR(20) NOT NULL,
AGE INT NOT NULL,
SEX TINYINT(1) UNSIGNED DEFAULT 0 NOT NULL
)AUTO_INCREMENT = 100000;
INSERT INTO STUDENT(NAME,AGE, ...
Posted on Fri, 17 Jul 2026 17:24:24 +0000 by SUNNY ARSLAN
Customizing Physical Table and Column Names in Hibernate
When working with a databsae that enforces consistent naming conventions—such as prefixing all table and columns with ycx_—manually annotating every entity and field using @Table and @Column becomes impractical for large schemas. A more scalable solution is to implement Hibernate’s PhysicalNamingStrategy interface to apply naming rules globally ...
Posted on Fri, 17 Jul 2026 16:31:15 +0000 by Ellen67
Redis Internal Storage Architecture and Data Structures
Redis Storage Structure
Value Encoding Types
Redis automatically selects the most efficient encoding format based on the characteristics of stored data:
String
int: String length ≤ 20 and convertible to integer
raw: String length > 44
embstr: String length ≤ 44
List
quicklist: Optimized linked list structure
ziplist: Compressed list for ...
Posted on Thu, 16 Jul 2026 16:59:55 +0000 by jeff2007XP
LeetCode SQL Problem Solutions (Part 4)
1907. Categorize Salary Counts
Table: Accounts
+-------------+------+
| Column | Type |
+-------------+------+
| account_id | int |
| income | int |
+-------------+------+
account_id is the primary key. Each row has monthly income of a bank account.
Query the number of accounts in each salary category:
Low Salary: income < 200 ...
Posted on Wed, 15 Jul 2026 16:44:03 +0000 by Bozebo
Essential MySQL Query Patterns and Performance Tactics
Pagination and Retrieval
To retrieve a specific subset of records sorted by time, use the LIMIT clause. MySQL does not support the TOP keyword found in other dialects.
SELECT * FROM media_assets
ORDER BY created_at DESC
LIMIT 10 OFFSET 5;
View Creation and Logic Precedence
Views can encapsulate complex filtering logic. Note that logical OR o ...
Posted on Wed, 15 Jul 2026 16:27:48 +0000 by aalmos
Advanced Data Retrieval: Sorting, Aggregation, and Grouping in SQL
Sorting Query Results
The ORDER BY clause is utilized to arrange the output of a query. You can specify sorting based on one or multiple columns. By default, the sort order is ascending (ASC), but you can explicitly request descending order (DESC). When handling columns containing NULL values, the standard behavior dictates that in ascending so ...
Posted on Tue, 14 Jul 2026 17:33:46 +0000 by mahenderp