April 2023 Summaries
2 posts from Upstash
Filter
Month:
Year:
Post Summaries
Back to Blog
Upstash Streams for Redis is a newly implemented feature that serves as an append-only log compatible with the Redis Streams API, designed to track continuous events such as user actions or sensor data. Unlike standard Redis Streams, Upstash Streams addresses the limitations of memory-based storage by implementing a disk-based system, allowing for greater scalability and eliminating the need to trim data due to memory constraints. This system stores entries on disk while keeping essential metadata in memory for efficient access, similar to Apache Kafka's partitioning and integration capabilities. Upstash has developed its own Redis server to prioritize multitenancy and scalability, providing users with the ability to fully utilize streaming APIs without memory restrictions, and invites feedback on their platforms.
Apr 25, 2023
753 words in the original blog post.
Inspired by Lee's blog, the author describes how to implement a page view counter using Next.js 13 and Upstash Redis, instead of a traditional MySQL database. The goal is to track and display the number of views on each page, achieved by using Redis commands such as SET with NX and EX options to deduplicate and prevent multiple increments from a single user within a given timeframe, and INCR to increment the view count. Setting up the Redis database on Upstash is straightforward, offering 10k requests per day for free. The implementation involves creating an API route to handle view counting and a client component to trigger the counter increment upon page load. Additionally, the author provides a method for displaying the view count using the GET command and suggests revalidating the page every 60 seconds to ensure up-to-date information. The complete code is available on GitHub, and further engagement is encouraged through Twitter or Discord for those interested in page view analytics.
Apr 03, 2023
1,179 words in the original blog post.