July 2022 Summaries
4 posts from Upstash
Filter
Month:
Year:
Post Summaries
Back to Blog
This text provides a guide on using QStash to create a serverless, scheduled function within a Next.js application to periodically fetch and store the current USD price of Bitcoin from blockchain.info into a Redis database. It outlines the setup process, including creating a Next.js application, installing the necessary dependencies (@upstash/redis and @upstash/qstash), and configuring an API handler to fetch and store data. The handler function is wrapped with verifySignature to ensure requests are from Upstash, and the application is deployed on Vercel with necessary environment variables. The final step involves using QStash to set a schedule for the function, allowing it to run periodically without additional infrastructure.
Jul 28, 2022
927 words in the original blog post.
The blog post provides a comprehensive guide on building and deploying a site using SvelteKit and Vercel's Edge Functions, which allows for dynamic page rendering at CDN-like speeds. It explains how to create a site that displays a list of cities from which users have visited, utilizing Vercel's edge headers to detect a user's city and country based on their IP address. The tutorial also demonstrates how to store and manage this data in a Redis database using Upstash, highlighting the setup of environment variables and Redis functions for storing and retrieving city data. Additionally, it covers deploying the application to Vercel, using the Vercel adapter in SvelteKit to enable edge functionality, and emphasizes the simplicity and efficiency of serverless deployment for global distribution. The tutorial is supplemented by code snippets, a live demo, and references to SvelteKit's documentation for further exploration of its features and capabilities.
Jul 25, 2022
1,780 words in the original blog post.
Next.js 12.2 introduces Edge API Routes, enabling developers to run APIs at edge locations for reduced latency globally, which is particularly beneficial for applications requiring low-latency access worldwide. An example project is outlined where a basic API counts page views for each edge location, utilizing Upstash Global Redis to maintain low latency by replicating data across multiple regions. The project setup involves creating a Next.js application, installing the Upstash Redis client, and deploying the application to Vercel, which supports the Edge runtime. The code includes importing necessary modules, setting up a Redis instance, and configuring the API to increment view counts based on user location. Upon deployment, the API can be tested from various locations, demonstrating different view counts for each region, showcasing the functionality of Edge API Routes and the benefits of using Upstash for global data replication in reducing latency.
Jul 22, 2022
282 words in the original blog post.
QStash is a message queue and task scheduler specifically designed for serverless runtimes, offering a lightweight and intuitive solution for managing communication between serverless functions. Unlike traditional messaging systems, QStash operates as a service without requiring users to maintain a backend, ensuring compatibility with stateless environments and allowing messages to be pushed directly to APIs. It supports features such as retries, custom delays, and scheduling through CRON expressions, enabling users to decouple services and handle asynchronous tasks efficiently. Pricing is flexible, with costs scaling to zero when not in use, and the service allows for endpoint and topic configurations to streamline message delivery. QStash is positioned as a versatile tool for developers building complex systems with serverless architectures, emphasizing ease of integration and scalability.
Jul 18, 2022
876 words in the original blog post.