Notes
Trying MySQL MEMORY Tables as a Simple Cache (and Failing Spectacularly)
- By Ercan
- 26/10/2025
Sometimes you want a quick in-app cache without adding Redis or Hazelcast. MySQL MEMORY tables look promising: “RAM-resident, fast, simple”. Curious, I decided to test it myself on a local development environment. Environment MySQL Server: 9.5.0 (Homebrew, default settings except max_heap_table_size) Local machine: MacBook Pro 15-inch, 2019, 2.3 GHz 8-Core Intel Core i9-9880H, 16 GB RAM MEMORY table max_heap_table_size: increased to 512 MB to accommodate 1 million rows Test scenario: 50 parallel threads Insert 1 million OTP tokens 50,000 read queries Benc..
String Boot Hexagonal Architecture Example
- By Ercan
- 25/10/2025
Architectural concepts like ports, adapters, domain, infrastructure frequently feel abstract when you first read about them. To move from theory to intuition I built a small, multi-module Spring Boot project: a calculator that performs addition, subtraction, multiplication and division, and logs every calculation to a database. The point of this project is not complex business logic — it’s to show how Hexagonal Architecture (aka Ports & Adapters) organizes code so the domain remains framework- and I/O-agnostic, while adapters provide concrete interfaces to the outside world (REST, SOAP,..
Spring Boot Bottom-Up SOAP Service Example
- By Ercan
- 22/10/2025
SOAP services are still widely used in enterprise systems and legacy integrations. However, new Spring Boot developers often struggle with WSDL, XSD, and Jakarta namespaces. In this blog, we will create a bottom-up SOAP service where the WSDL is automatically generated from Java classes and annotations. The project uses jaxws-spring-jakarta, a modernized SOAP runtime compatible with Spring Boot 3. TL;DR: If you want to skip the explanation and dive straight into the code, check out the full implementation on GitHub: https://github.com/ercansormaz/soap-producer-bottom-up ..
Spring Boot Command Pattern Example
- By Ercan
- 21/10/2025
The Command Pattern is one of the most versatile and widely used behavioral design patterns. It encapsulates a request as an object, allowing you to parameterize, queue, and execute actions dynamically — all without tightly coupling the caller to the actual logic being executed. In this article, we’ll explore how to apply the Command Pattern in a real-world Spring Boot project, where we execute different text encoding and decoding algorithms such as Caesar, Atbash, and ROT13. This example is designed to be both educational and practical — ideal for developers who want to deeply understan..
Spring Boot Template Method Pattern Example
- By Ercan
- 19/10/2025
Design patterns are timeless tools that bring structure and clarity to software projects. In this post, we’ll explore how to use the Template Method Pattern within a Spring Boot application — through a simple but practical example: an Email Builder API. TL;DR: If you want to skip the explanation and dive straight into the code, check out the full implementation on GitHub: https://github.com/ercansormaz/template-method-pattern What Is the Template Method Pattern? The Template Method Pattern defines the skeleton of an algorithm in a base (abstract) class and allows subclasses to redef..
Spring Boot Rate Limiting Example based on Redis
- By Ercan
- 15/10/2025
Rate limiting is one of the most fundamental building blocks in backend engineering — it protects your system from excessive requests, ensures fair usage, and prevents overload. While there are countless ways to implement it, achieving both accuracy and efficiency in a distributed environment is a more delicate challenge. In this post, I’ll share my hands-on experience building a Redis-based rate limiting system in Spring Boot, comparing five popular algorithms, and highlighting how Lua scripting can significantly improve performance and reliability. Project Overview The project, a..
Spring Boot Iterator Pattern Example
- By Ercan
- 28/09/2025
When working with multiple processing strategies—such as hashing algorithms—it is common to loop through a collection and apply each one. However, directly exposing the collection and iterating outside the component can make the code fragile and tightly coupled. This is where the Iterator Pattern comes into play. TL;DR: If you want to skip the explanation and dive straight into the code, check out the full implementation on GitHub: https://github.com/ercansormaz/iterator-pattern The Use Case: Hashing Text with Multiple Algorithms Our Spring Boot application takes a text input and re..
Spring Boot Chain of Responsibility Pattern Example
- By Ercan
- 26/09/2025
The Chain of Responsibility is a behavioral design pattern that allows us to process a request through a sequence of handlers. Each handler decides whether it can process the request or pass it along to the next handler in the chain. In this article, we will demonstrate how this pattern can be applied in a Spring Boot application to resolve which hashing algorithm was used for a given hash. TL;DR: If you want to skip the explanation and dive straight into the code, check out the full implementation on GitHub: https://github.com/ercansormaz/chain-of-responsibility-pattern Problem to ..
Spring Boot Strategy Pattern Example
- By Ercan
- 25/09/2025
Design patterns are one of the most valuable tools in a developer’s toolkit. They provide proven solutions to recurring design problems and help us write code that is maintainable, flexible, and easy to extend. One of the most practical patterns in everyday software development is the Strategy Pattern. In this article, we’ll look at how the Strategy Pattern can be applied in a real-world example using Spring Boot. We will build a simple REST API that takes a piece of text and returns its hash, depending on the algorithm selected by the client. The project is a minimal but effective demonstr..
Advanced MySQL Query Techniques
- By Ercan
- 19/07/2025
Most developers interact with MySQL through familiar CRUD operations — simple SELECT, INSERT, and UPDATE statements. But MySQL 8 introduced a new set of powerful features that can handle advanced analytical use cases, hierarchical data, and complex aggregations directly within SQL. In this guide, we’ll explore practical, non-standard but extremely useful query patterns, all using plain MySQL 8+. Each section includes example tables, real-world use cases, and a short explanation of how and why the query works. 💡 Note: All queries in this article require MySQL 8.0 or higher (due to CTEs,..
