Tech Musings
Author

Tech Musings

Capturing thoughts and reflections while coding.

64
Articles
0
Likes
410
Views
0
Comments
Recent Articles

Latest from Tech Musings

64 recent articles
Tech Musings
Tech Musings
Jul 11, 2021 · Fundamentals

Why Distributed Consistency Algorithms Matter and How Raft Achieves Consensus

This article explains why distributed systems need consistency algorithms, compares weak and strong consistency, outlines the challenges of unreliable networks and clocks, and provides a detailed walkthrough of the Raft consensus protocol, its node states, state variables, RPCs, and a practical lab implementation for leader election.

Consensus AlgorithmDistributed SystemsLeader Election
0 likes · 12 min read
Why Distributed Consistency Algorithms Matter and How Raft Achieves Consensus
Tech Musings
Tech Musings
Jul 8, 2021 · Big Data

Building a Simple Single-Node MapReduce System: From Theory to Code

This article walks through implementing a lightweight single‑machine MapReduce framework inspired by the original MapReduce paper, covering the abstract Map/Reduce model, task scheduling between master and workers, core Go code for map, reduce, worker, and coordinator, and a brief reflection on its limitations.

Big DataDistributed SystemsLab
0 likes · 10 min read
Building a Simple Single-Node MapReduce System: From Theory to Code
Tech Musings
Tech Musings
May 14, 2021 · Databases

How to Diagnose and Fix MySQL Deadlocks Using Locks and Indexes

This article explains why MySQL deadlocks occur in a test module, details table and row lock mechanisms, reproduces the deadlock scenario with two sessions, analyzes lock logs, and provides a solution by adding a composite index to prevent the conflict.

DeadlockInnoDBLock
0 likes · 19 min read
How to Diagnose and Fix MySQL Deadlocks Using Locks and Indexes
Tech Musings
Tech Musings
May 18, 2020 · Fundamentals

Master Multi‑Round Interview Coding: Parsing, Concurrency, and Matrix Multiplication

This article walks through three typical interview coding rounds—implementing a robust string‑to‑int parser, designing a high‑concurrency trace‑storage API, and building a matrix multiplication routine with performance and sparse‑matrix optimizations—providing code examples, corner‑case handling, and improvement ideas.

Matrix multiplicationalgorithm optimizationcoding interview
0 likes · 7 min read
Master Multi‑Round Interview Coding: Parsing, Concurrency, and Matrix Multiplication
Tech Musings
Tech Musings
Mar 27, 2020 · Fundamentals

How Virtual Functions Expand C++ Class Size and Shape Memory Layout

This article explains how C++ compilers implement virtual functions using a hidden vptr and virtual table, showing how class size grows from 1 to 8 bytes, detailing memory layouts for single, multiple, and diamond inheritance, and providing commands to dump vtable and layout information.

C++InheritanceMemory Layout
0 likes · 14 min read
How Virtual Functions Expand C++ Class Size and Shape Memory Layout
Tech Musings
Tech Musings
Mar 23, 2020 · Backend Development

Mastering Multipart/Form-Data: From AJAX FormData to Spring Boot Backend

This guide explains how multipart/form-data enables sending JSON and binary data together, outlines its essential specifications, demonstrates front‑end FormData usage, and details Spring Boot back‑end handling with @RequestParam and @RequestPart annotations.

AJAXBackendFormData
0 likes · 4 min read
Mastering Multipart/Form-Data: From AJAX FormData to Spring Boot Backend
Tech Musings
Tech Musings
Oct 31, 2019 · Databases

Master MySQL Tricks: Upserts, Ignoring Errors, Joins, Pagination & More

This guide explores advanced MySQL techniques—including ON DUPLICATE KEY UPDATE for upserts, INSERT IGNORE to bypass errors, replacing subqueries with JOINs, handling LEFT JOIN pitfalls, efficient pagination strategies, multi‑table UPDATE/DELETE via JOIN, and the nuances of COUNT(*) versus COUNT(1).

COUNTDatabase OptimizationJOIN
0 likes · 12 min read
Master MySQL Tricks: Upserts, Ignoring Errors, Joins, Pagination & More