Rinhabackend Rails Api

screenshot of Rinhabackend Rails Api

Overview

The Rinha Backend API is an innovative project that emerged from a community challenge in August 2023, aimed at creating a performance-oriented Rails API application capable of withstanding serious stress tests. Designed to operate within the restrictive limits of 1.5 vCPU and 3GB of RAM, this API pushes the boundaries of what can be achieved in terms of speed and efficiency. The developer's experimentation led to several optimizations that, while not recommended for production use, showcase the possibilities of flexible coding and configuration.

The project is over-engineered intentionally for the sake of exploration and learning, and it delivers impressive results with a throughput of nearly 40,000 requests. The journey of trial and error highlighted the intricacies of configuration, particularly in adjusting connection limits within Docker. Whether you're a developer looking to test your API skills or simply curious about optimizing performance, the Rinha Backend API stands as a testament to what can be done in constrained environments.

Features

  • Performance Optimization: Crafted to maximize speed without breaking Rails conventions, ensuring robust performance during stress tests.
  • Redis Integration: Utilizes Rails.cache with Redis for efficient caching, allowing for quicker data retrieval and management.
  • Asynchronous Processing: Implements Sidekiq for async jobs, optimizing data insertion and processing to handle high loads more efficiently.
  • Stress Test Ready: Specifically designed to endure intense stress tests, making it ideal for performance benchmarking and optimization exploration.
  • Flexible Configuration: Offers a "docker-compose-ideal.yml" setup for those with access to more resources, illustrating the potential for scaling beyond minimal constraints.
  • Detailed Execution Instructions: Provides clear steps for running the application and performing stress tests, making it user-friendly for those looking to experiment.
  • Community Engagement: Inspired by a collaborative challenge, this project highlights the power of community-driven development and innovative problem-solving.