Redis Data Structures: A Pythonic Interface for Distributed Data Structures Introducing redis-data-structures - A Python library providing high-level, Redis-backed data structures with a clean, Pythonic interface.
Build your own Redis (2/5) - Redis Persistence Following the previous post, now, we will talk about redis persistence. While primarily known as an in-memory database, Redis offers a sophisticated durability model through two complementary strategies: RDB snapshots and AOF logs. Let's dive deep into how these work, implementing our own RDB parser along the way.
Build your own Redis (1/5) - Redis Serialization Protocol and Concurrency Model Redis represents a masterclass in systems design, particularly in how it balances performance with architectural elegance. Through implementing a Redis-compatible server via the CodeCrafters challenge, we'll deconstruct two fundamental architectural decisions that shape Redis's behavior: its wire protocol (RESP) and its event-driven concurrency model. If you&
How to Control the Creativity of LLMs Using the Temperature Parameter When working with Large Language Models (LLMs), one of the most powerful yet often misunderstood parameters is "temperature". This setting acts as a creativity dial, allowing you to fine-tune the model's output between deterministic precision and creative exploration. Let's dive into what temperature means
How Computers Generate Random Numbers Imagine this: you're playing your favorite video game, and an enemy drops a rare item. Or maybe you're shuffling your Spotify playlist, wondering how it picks the next song. Behind these everyday moments lies a fascinating paradox: how do computers, which are fundamentally deterministic machines, create
LeetCode - First Missing Positive Description: https://leetcode.com/problems/first-missing-positive/description/ This problem requires finding the smallest missing positive integer in an unsorted array. The key challenge is achieving %O(N)% time and %O(1)% space complexity without using extra space for hash tables. Key insights: * Since we're looking for the first
LeetCode - Trapping Rain Water Description: https://leetcode.com/problems/trapping-rain-water/description/ To solve this problem, the main observation is that at each index i, the amount of water that can be trapped depends on the the highest bars to its left and right elements, minus its own height. Key insights: * Water level at index_
Building a Database From Scratch: Understanding LSM Trees and Storage Engines (Part 1) Learn core database concepts by implementing a Python key-value store with crash recovery and efficient writes. In this tutorial, we'll build a simple but functional database from scratch with Python. Through this hands-on project, we'll explore core database concepts like Write-Ahead Logging (WAL), Sorted String Tables
The Easiest Way to Add Code Interpreter into Your LLM Apps Hey mate, I recently tried to add something like the ChatGPT Code Interpreter plugin to my LLM application. I found many libraries and open-source options available, but they seemed a bit complicated to set up, and some required credits for cloud computing. So, I decided to develop my own library
Concurrency Programming in Python: Thread vs. Process Concurrency is a vital aspect of modern programming, allowing applications to perform multiple tasks simultaneously, thus improving efficiency and responsiveness. In Python, developers often face the choice between using threads or processes to achieve concurrency. This blog explores the differences between these two concurrency models, how they interact with Python&