Best of Redis — 2024

  1. 1
    Article
    Avatar of hnHacker News·2y

    The secret inside One Million Checkboxes

    One Million Checkboxes (OMCB) was a web project launched on June 26th, 2024, which allowed 500,000 users to check over 650 million boxes collectively. Each change was global and instantaneous. The author initially thought the database had been hacked due to strange data, but it was revealed users were sending hidden binary messages. A community of sharp young developers formed around the project, creating elaborate drawings and complex animations using checkboxes. Despite concerns about botting degrading user experience, the author found the creative interaction deeply moving and reminiscent of his own early programming experiences.

  2. 2
    Article
    Avatar of lobstersLobsters·2y

    Scaling One Million Checkboxes to 650,000,000 checks

    One Million Checkboxes (OMCB) is a website that scaled from a few expected users to over 650 million checks within days. The architecture involved using Redis for state management, nginx for static content and reverse proxy, and Flask for API handling. The site faced several challenges including unexpected high traffic, Redis connection issues, and bandwidth costs. Solutions included adding more servers, batching updates, using a connection pool, and eventually rewriting the backend in Go, which significantly improved performance. The project emphasized learning and fun over perfect solutions, leading to valuable scaling insights.

  3. 3
    Article
    Avatar of communityCommunity Picks·2y

    Build Redis from scratch

    This series guides you through building an in-memory database similar to Redis using Go. It focuses on low-level details involving databases, data structures, and algorithms. The project highlights include understanding RESP for command parsing, using goroutines for multiple connections, and implementing data persistence with the Append Only File (AOF) method. Suitable for developers familiar with Go and Redis commands.

  4. 4
    Article
    Avatar of communityCommunity Picks·2y

    Design a Robust School Bus Tracker System

    This post discusses the architecture for a school bus tracker system, focusing on real-time monitoring and parental notifications. Key functional requirements include frequent location updates, real-time map visualization, proximity notifications, and data isolation between schools. Non-functional requirements involve scalability, high availability, reliability, security, and privacy. The post elaborates on various technical aspects such as API design, geohashing for location indexing, and using Redis for real-time updates. It also covers the system’s read/write ratio, proposing DynamoDB, and explores various scalability strategies using AWS managed services.

  5. 5
    Article
    Avatar of communityCommunity Picks·2y

    Build a Caching Layer in Node.js With Redis

    Learn how to build a caching layer in Node.js using Redis to improve the performance of your backend and increase the number of concurrent users. Redis is an in-memory data repository that provides extreme performance and efficiency for caching. By encapsulating caching logic in a middleware function, you can choose which routes to apply caching to, reducing code duplication and improving maintainability. This step-by-step tutorial shows you how to set up a Redis caching layer in an Express application and provides extra tips on compressing data for better memory utilization.

  6. 6
    Article
    Avatar of canvaCanva Engineering·2y

    Real-time mouse pointers

    Anton from Canva's Collaboration team discusses the implementation of real-time mouse pointers for the company's whiteboard product. Initially developed using WebSockets and Redis for backend-centric architecture, the system supported millions of users. To further reduce latency and backend load, the final architecture transitioned to WebRTC, leveraging peer-to-peer connections for better scalability and responsiveness. WebRTC offers lower latency and higher throughput, ideal for real-time applications, though it introduces additional complexity on the frontend.

  7. 7
    Article
    Avatar of bytebytegoByteByteGo·2y

    EP131: How Uber Served 40 Million Reads with Integrated Redis Cache?

    Uber uses an integrated caching solution named CacheFront with Redis, Docstore, and MySQL for efficient data handling. The system fetches data from Redis for cache hits and uses MySQL for cache misses, leveraging a CDC service for invalidation. Multi-region cache warming with Redis streaming handles potential database overloads during region fail-overs, while strategic sharding ensures even load distribution across instances.

  8. 8
    Article
    Avatar of communityCommunity Picks·2y

    Can Postgres replace Redis as a cache?

    The post discusses the possibility of using Postgres as a cache instead of Redis, highlighting that while Postgres can simplify the technology stack and reduce costs, it lacks the performance and specialized features of Redis. Unlogged tables in Postgres improve write performance but not read performance. Moreover, Redis offers built-in features like expiration and eviction policies that are complex to implement in Postgres. Ultimately, Redis is recommended for its superior performance and simplicity in use as a caching solution.

  9. 9
    Article
    Avatar of communityCommunity Picks·2y

    How I built my open-source Social media scheduling tool... 🤯

    Postiz, an open-source social media scheduling tool, leverages OAuth2 for authentication across different platforms. It uses Redis for queue management to schedule posts and Prisma ORM for database operations with PostgreSQL. The tool's architecture supports horizontal scaling with microservices called 'Workers' to handle post jobs efficiently.

  10. 10
    Article
    Avatar of communityCommunity Picks·2y

    Power of Redis: A Deep Dive into Caching Systems

    Explore the power of Redis and its caching techniques, including in-memory storage, optimized data structures, and reduced I/O operations. Learn about the various types of caching, the diverse data structures supported by Redis, and the factors to consider when choosing a caching system.

  11. 11
    Article
    Avatar of devtoDEV·2y

    How to implement a Distributed Lock using Redis

    Running multiple instances of an application can create issues with concurrent database writes, potentially leading to inconsistent states. Distributed locking, particularly using Redis, provides a solution by ensuring only one instance can perform critical operations at a time. The Redlock algorithm is an effective method for implementing distributed locks across multiple Redis instances, ensuring consistency even if some instances fail.

  12. 12
    Video
    Avatar of t3dotggTheo - t3․gg·2y

    RIP Redis?

    Redis has changed its license, moving away from open source and implementing a new source available license. This decision has sparked controversy and disappointment among the community. It has also raised questions about the impact on companies using Redis and the viability of alternative solutions.

  13. 13
    Article
    Avatar of bytebytegoByteByteGo·2y

    How Uber Uses Integrated Redis Cache to Serve 40M Reads/Second?

    Uber uses an integrated Redis cache called CacheFront to serve 40M reads per second. It helps overcome challenges with low latency database reads and provides scalability, reduced load, and cost savings.

  14. 14
    Article
    Avatar of hnHacker News·2y

    How to do distributed locking — Martin Kleppmann’s blog

    The post examines the Redlock algorithm for distributed locking on Redis, highlighting its limitations in terms of timing assumptions and lack of support for fencing tokens, which are crucial for ensuring correctness. It argues that while Redis is suitable for some non-critical locking scenarios, Redlock may not be reliable for critical applications requiring strong consistency. It suggests using more robust consensus algorithms like ZooKeeper when correctness is essential.

  15. 15
    Article
    Avatar of communityCommunity Picks·2y

    One Million Checkboxes

    The creator of 'One Million Checkboxes' shares insights into the rapid development and scaling of his website, utilizing bit arrays, Redis, WebSockets, and React-window for performance. A peculiar bug related to bit ordering is discussed, highlighting the challenges of efficient checkbox state management in a collaborative setting.

  16. 16
    Article
    Avatar of lobstersLobsters·2y

    The Fastest In-Memory Data Store

    Dragonfly is a performant and cost-efficient in-memory data store that offers 25x more throughput and 12x faster snapshotting than Redis. It is an easy drop-in replacement for Redis without any code changes.

  17. 17
    Article
    Avatar of communityCommunity Picks·1y

    An Elegant NodeJS framework

    Enhance your application's performance with this NodeJS framework that offers multi-store Redis and in-memory cache configuration. It supports MySQL and Postgres databases with a declarative syntax. Built-in error handling, Sentry integration, and elegant APIs for AWS S3 and local storage streamline your development process. The framework also features localization, message queues, a powerful code generation tool, and an integrated HTML mail template system.

  18. 18
    Article
    Avatar of implementingImplementing·2y

    How to Implement Leaderboard with Redis Sorted Sets and Node.js

    This post explains how to implement a leaderboard using Redis Sorted Sets and Node.js. It discusses the advantages of using Redis Sorted Sets over a relational database solution and provides recommendations for scaling up the solution. The post also includes a bonus section on trying the application with a UI.

  19. 19
    Video
    Avatar of communityCommunity Picks·2y

    Modern Redis Crash Course: Backend with Express, TypeScript and Zod

    Learn how to implement Redis in a Node.js project using Express and TypeScript, with a focus on understanding Redis as an in-memory data store and its use cases for caching and primary data storage. The course covers setting up a Redis client, creating middleware for standardized API responses, and using Zod for schema validation. Using a project-based approach, you'll build a restaurant directory backend with endpoints for viewing, ranking, searching, and getting weather information.

  20. 20
    Article
    Avatar of communityCommunity Picks·1y

    Build a URL Shortener with Go, Redis, and HTMX

    Learn to build a URL Shortener using Go, Redis, and HTMX. The tutorial covers setting up the Go environment, installing Redis, building a basic HTTP server with Go’s standard library, and implementing a simple URL shortening algorithm. It also includes instructions for integrating Redis as a fast in-memory data store, and creating a reactive UI with HTMX and TailwindCSS. The final steps involve setting up URL redirection and deploying the application.

  21. 21
    Article
    Avatar of communityCommunity Picks·1y

    Implementing Group Chat with Redis Pub/Sub in Next.js 15

    Discover how to build a scalable group chat application using Redis Pub/Sub and Next.js 15. Learn the fundamentals of Redis Pub/Sub, how to set up a Next.js project, and implement key features such as message sending, retrieval, and user management. The tutorial also addresses UI design and real-time functionalities, providing a foundation for building robust chat applications.

  22. 22
    Article
    Avatar of gcgitconnected·2y

    Why and how you should rate-limit your API

    Rate limiting is essential for managing traffic, controlling costs, and providing a smooth user experience for APIs. It involves setting request limits per time period to handle traffic loads efficiently. Key rate limiting policies like fixed window, sliding window, token bucket, and leaky bucket have specific use cases and trade-offs. Implementation can be done at proxy or application levels, providing different degrees of control. The article walks through setting up a rate limiting service using Go, Redis, and the leaky bucket policy, emphasizing practical tips and the importance of monitoring and adjustments.

  23. 23
    Article
    Avatar of communityCommunity Picks·2y

    Do You Really Need Redis? How to Get Away with Just PostgreSQL

    Redis is often used for job queuing, distributed locking, and pub/sub mechanisms in web services. However, PostgreSQL has features like `SKIP LOCKED`, advisory locks, and the `LISTEN/NOTIFY` statements that can achieve these tasks effectively. This can help simplify your architecture by using just PostgreSQL and reduce operational costs associated with maintaining multiple data services.

  24. 24
    Article
    Avatar of java_libhuntAwesome Java Newsletter·2y

    How to implement a Distributed Lock using Redis

    Handling critical sections in distributed systems can be complex, especially when multiple instances might update the same database. Implementing distributed locking ensures that only one instance performs a critical operation at any given time. Using Redis, both single-instance and Redlock algorithms provide solutions, although they come with their own challenges, such as handling failover in master-replica setups.

  25. 25
    Article
    Avatar of communityCommunity Picks·2y

    Laravel Reverb

    Reverb is a first-party WebSocket server for Laravel applications, providing real-time communication between client and server. It offers speed, scalability with Redis, and compatibility with Laravel broadcasting and Laravel Echo.