Fading Coder

One Final Commit for the Last Sprint

Database Read-Write Separation with Sharding-JDBC

Overview A common database architecture optimization involves a single master and multiple slaves, with read-write separation and active synchronization. When an application has more read operations than write operations and the database struggles with read load, read-write separation can linearly i...

Working with Database Triggers: From Theory to MySQL Implementation

What Are Database Triggers? A trigger is a specialized database object that automatically executes in response to certain events on a specific table or view. Unlike regular stored procedures, triggers cannot be invoked manually—they fire automatically when INSERT, UPDATE, or DELETE operations occur...

Deploying a High-Availability Redis Cluster on CentOS 7

System Environment and Prerequisites This guide outlines the procedure for establishing a Redis Cluster with six nodes (three masters and three slaves) on a sinngle CentOS 7 server. In a production setting, these instances should be distributed across multiple physical servers to ensure true fault t...

Implementing SQL NOT NULL Constraints for Data Integrity

The NOT NULL constraint acts as a rule enforcing that a specific column cannot store undefined or missing values. This restriction is fundamental for maintaining data integrity, ensuring that every record in the database contains essential information for designated fields.Applying this constraint d...

Java JDBC Core Concepts & Practical Implementation: Connection Acquisition, ResultSet, Batch Processing, Transactions, Pools, and Apache Commons DBUtils

JDBC provides a vendor-neutral API layer that abstracts database-specific implementation details, enabling Java applications to interact with any relational databace that supplies a compliant JDBC driver. This standardization eliminates the need to rewrite core data base interaction logic when switc...

Retrieving Auto-Generated Keys in MyBatis

In database operations, we often need to retrieve auto-generated primary key values after inserting records. MyBatis provides two approaches to accomplish this: using the useGeneratedKeys attribute and the selectKey element. Using useGeneratedKeys Attribute The useGeneratedKeys attribute enables aut...

Redis Configuration Essentials (redis.conf)

Redis Configuration File Overview The Redis configuration file resides in the Redis installation directory with the filename redis.conf. Configuration Methods Method 1: Direct modification of the redis.conf file content. Method 2: Using the CONFIG command to view or modify settings. CONFIG Command U...

Core Redis Concepts: Cluster Management, Memory, and Performance

Identifying Redis Hot KeysTechniqueAdvantagesDisadvantagesCLI Hot Key DetectionStraightforward execution, rapid hotspot isolationConstrained scan window, potential performance overheadKeyspace NotificationsReal-time tracking, highly adaptableResource intensive, elevated setup complexitySlow Query An...

Redis String Data Type: Complete Command Reference

SET 127.0.0.1:6379> set user_id 42 OK GET 127.0.0.1:6379> get user_id 42 #Retrieve all keys 127.0.0.1:6379> keys * item3 item2 item1 SET (Update) 127.0.0.1:6379> set user_id 99 OK 127.0.0.1:6379> get user_id 99 DEL 127.0.0.1:6379> del user_id 1 127.0.0.1:6379> get user_id (nil)...

Core Concepts and Syntax of SQL for Relational Database Management

SQL (Structured Query Language) manages data in relational database management systems (RDBMS). It supports inserting, querying, updating, deleting data, creating and modifying schemas, and controlling access. A relational DBMS stores data in tables composed of rows and columns. Each table represent...