MongoDB Atomic Operations
MongoDB Atomic Operations
MongoDB does not support multi-document ACID transactions. Therefore, you must design your application logic to handle data consistency without relying on the database for cross-document integrity. However, MongoDB provides a comprehensive set of atomic operations for single-document modifications. An atomic operation ...
Posted on Mon, 18 May 2026 23:20:16 +0000 by Hardbyte
Ensuring Redis Cache and Database Consistency with Delayed Double Deletion
Redis Cache and Database Consistency
Caching improves performance and reduces database load, but introduces potential inconsistencies between cached data and the database. Inconsistent data leads to stale reads from the cache.
Non-Concurrency Scenarios
Update Cache First, Then Database
If cache udpate succeeds but database update fails, the cac ...
Posted on Mon, 18 May 2026 21:24:00 +0000 by DwarV
Deploying MySQL 8.0 on CentOS 7: A Step-by-Step Walkthrough
Prerequisites and Initial Setup
Start with a minimal CentOS 7 environment to avoid conflicts. Create a temporary workspace for the installation bundle.
mkdir -p /mysql
cd /mysql
wget https://cdn.mysql.com/archives/mysql-8.0/mysql-8.0.16-2.el7.x86_64.rpm-bundle.tar
tar -xvf mysql-8.0.16-2.el7.x86_64.rpm-bundle.tar
Cleaning Up Existing MariaDB o ...
Posted on Mon, 18 May 2026 17:50:33 +0000 by FURQAN
Oracle Database Query Techniques and Object Management
1. String Concatenation Operator
SELECT 'Employee: ' || ename || ', Role: ' || job || ', Salary: ' || sal AS details FROM emp;
2. Convert Strings to Lowercase
SELECT LOWER(ename) AS lowercase_name FROM emp;
3. Value Replacmeent
SELECT DECODE(deptno, 10, 'Development', 20, 'Product', 30, 'Maintenance') AS department FROM emp;
4. Extract Curre ...
Posted on Mon, 18 May 2026 11:54:38 +0000 by vponz
Understanding MySQL COUNT Window Function with Practical Examples
Window functions in MySQL enable advanced data analysis by performing calculations across rows without collapsing the result set. The COUNT() window function specifically allows counting elements within a defined window partition while preserving individual row details.
How Window Functions Work
Unlike traditional aggregate functions that group ...
Posted on Sun, 17 May 2026 23:26:58 +0000 by moonoo1974
Implementing One-to-One Mappings in MyBatis
Database Schema Setup
Create tables for identity cards and students, where each student references one card via a foreign key.
CREATE TABLE identity_cards (
card_id INT PRIMARY KEY,
card_number VARCHAR(20)
);
CREATE TABLE students (
student_id INT PRIMARY KEY,
student_name VARCHAR(10),
card_ref INT,
FOREIGN KEY (card_re ...
Posted on Sun, 17 May 2026 20:36:52 +0000 by guru2k9
MySQL Database Operations: Creation, Modification, and Querying Techniques
Creating a Practice Database and Tables
The standard MySQL database for common operations is db_school, while db_practice serves as a learning environment. Understanding how to create tables, modify their structure, and define constraints is fundamental for effective database management.
Setting Up the Practice Environment
# Remove existing ...
Posted on Sun, 17 May 2026 15:11:41 +0000 by billybathgate
Querying All Records from a MySQL Table Using JDBC
Database Table Setup
First, create a sample MySQL table for demonstration:
DROP TABLE IF EXISTS products;
CREATE TABLE products (
id INT PRIMARY KEY AUTO_INCREMENT,
product_name VARCHAR(50),
vendor_name VARCHAR(50),
price INT,
details VARCHAR(200),
available INT
);
INSERT INTO products (product_name, vendor_name, price ...
Posted on Sun, 17 May 2026 10:31:06 +0000 by edwardtilbury
Efficient Pagination and Window Functions in SQL Server
Paginatoin with Separate Count Query
When implementing pagination in SQL Server, one common approach is to execute two separate queries—one to retrieve the total record count and another to fetch the actual data page.
-- Retrieve total number of matching records
SELECT COUNT(*) AS TotalRecords
FROM Products
WHERE CategoryId = 5 AND IsActive = 1 ...
Posted on Sun, 17 May 2026 03:50:15 +0000 by Code_guy
Database Operations Fundamentals
Data Definition Language (DDL)
Database Operations
Creating Databases
-- Create a new database
CREATE DATABASE db_name;
-- Create database only if it doesn't exist
CREATE DATABASE IF NOT EXISTS db_name;
-- Create database with specific character set
CREATE DATABASE db_name CHARACTER SET charset_name;
-- Example: Create db4 with gbk charset ...
Posted on Sat, 16 May 2026 23:49:13 +0000 by object