Skip to content
StackPractices

Mathias Paulenko

Software Engineer & Founder of StackPractices

Mathias Paulenko

Mathias Paulenko

Software Engineer

Software engineer with 12+ years of experience building production systems across Python, JavaScript, React, and DevOps. I have contributed to enterprise projects spanning CI/CD pipelines, API design, cloud infrastructure, and full-stack development.

StackPractices is my personal project, born from a simple belief: great documentation should be copy-paste ready. Every recipe, pattern, and guide on this site is designed to save you time and help you ship faster.

Published Works (1032)

intermediate

Compose LCEL Chains in LangChain for Multi-Step LLM

Build composable LLM pipelines with LangChain Expression Language (LCEL) using pipes, parallel execution, and custom runnable components

intermediate

Evaluate RAG Quality with RAGAS Metrics

Measure RAG pipeline quality using RAGAS framework metrics — faithfulness, answer relevancy, context precision, and context recall for...

intermediate

Stream LLM Output with Server-Sent Events (SSE)

Stream LLM responses to clients in real-time using Server-Sent Events with FastAPI, OpenAI streaming, and async generators for...

intermediate

Run LLMs Locally with Ollama for Private Inference

Install and use Ollama to run open-source LLMs locally with Python, including streaming, embeddings, function calling, and model management...

intermediate

Compare Text Semantic Similarity with OpenAI Embeddings

Generate text embeddings with OpenAI and compute cosine similarity to measure semantic similarity between texts for search, dedup, and...

intermediate

Structured JSON Output from OpenAI Function Calling

Use OpenAI function calling and structured outputs to get reliable JSON from LLMs with Pydantic validation and error handling

intermediate

a Local RAG Pipeline with ChromaDB and Sentence Transformers

Implement retrieval-augmented generation locally with ChromaDB, sentence-transformers embeddings, and LLM generation without external API...

intermediate

Store and Query Embeddings in Pinecone Vector Database

Use Pinecone to store, query, and filter vector embeddings for semantic search with metadata filtering and namespace isolation

intermediate

JavaScript Fetch Retry Logic with Exponential Backoff

Retry failed HTTP requests in JavaScript with exponential backoff

intermediate

Node.js WebSocket Real-Time Communication with Socket.io

Build real-time WebSocket applications in Node.js with Socket.io

intermediate

Python API Rate Limiting with Token Bucket

Implement token bucket rate limiting in Flask and FastAPI with Redis support

intermediate

Node.js JWT Authentication: Verify and Refresh Tokens

Implement JWT authentication in Node.js with access and refresh tokens

intermediate

Node.js OAuth2 GitHub Login with Express

Implement GitHub OAuth2 login flow in Node.js with Express and Passport

intermediate

CDN Cache Invalidation Strategies and Patterns

Implement CDN cache invalidation using purge APIs, surrogate keys, tag-based invalidation, and versioned URLs to keep content fresh

advanced

Multi-Level Cache with In-Memory L1 and Redis L2

Implement a two-level cache combining in-memory L1 and Redis L2 for low-latency reads with cross-instance consistency

intermediate

Implement an LRU Cache in Node.js

Build a least-recently-used cache in Node.js with O(1) get and set operations using a Map-based doubly linked list

intermediate

Cache Function Results with Redis and TTL in Python

Build a Python decorator that caches function return values in Redis with configurable TTL, key generation, and cache invalidation

intermediate

Implement the Cache-Aside Pattern with Redis

Use the cache-aside pattern to read and write data through Redis, handling cache misses, stale reads, and write-through invalidation

advanced

Distributed Locking with Redis and Redlock

Implement distributed locks with Redis for mutual exclusion across processes, using SET NX with TTL and the Redlock algorithm for...

intermediate

Redis Pub/Sub for Cross-Process Messaging

Use Redis pub/sub channels to broadcast events between processes, handle subscriptions, and implement real-time notifications

advanced

Rate Limiting with Redis Token Bucket Algorithm

Implement a distributed token bucket rate limiter using Redis atomic operations for API throttling across multiple server instances

intermediate

Build a Real-Time Leaderboard with Redis Sorted Sets

Use Redis sorted sets to implement real-time leaderboards with rank tracking, score updates, and top-N queries in O(log N) time

intermediate

Make Concurrent HTTP Requests with Python and aiohttp

Fetch multiple APIs concurrently using asyncio and aiohttp. Covers connection pooling, rate limiting, retries, and batch processing.

intermediate

Schedule Periodic Tasks in Python with APScheduler

Run cron-like jobs in Python using APScheduler. Covers interval, cron, and date triggers, job stores, and background scheduling.