Best of Foojay.ioJanuary 2025

  1. 1
    Article
    Avatar of foojayioFoojay.io·1y

    Rate limiting with Redis: An essential guide

    Rate limiting is essential for managing traffic, preventing abuse, and ensuring fair access to resources. Redis is a preferred tool for implementing rate limiting due to its speed, reliability, and features. The choice of rate-limiting pattern, such as leaky bucket, token bucket, fixed window counter, sliding window log, or sliding window counter, depends on traffic patterns, precision needs, and resource constraints. Understanding these patterns and their trade-offs helps in building efficient, fair, and user-friendly systems.

  2. 2
    Article
    Avatar of foojayioFoojay.io·1y

    How JVM handles exceptions

    The JVM handles exceptions through a structured mechanism involving bytecode instructions and an exception table. When an exception is thrown, the JVM looks up the appropriate handler in the method's exception table. Handlers can be catch or finally blocks, and each handler specifies a range of instructions it covers and a target address where execution should continue. If no handler is found, the JVM looks up the call stack until it finds an appropriate handler, executing any finally blocks it encounters along the way.

  3. 3
    Article
    Avatar of foojayioFoojay.io·1y

    The Proper Way to Define Configuration Properties in Spring

    Learn the proper way to define configuration properties in Spring Boot 3 after migrating from Spring Boot 2. Understand the issues with using Lombok and classes, and how to address them by using records. Discover how to validate configuration properties at start-up time and document your configuration for better IDE support.