Home / Companies / Upstash / Blog / April 2022

April 2022 Summaries

9 posts from Upstash

Filter
Month: Year:
Post Summaries Back to Blog
Fly.io is a platform for globally distributing applications, and when paired with Upstash Redis Global Database, it provides a solution for globally replicated data. While standard Redis can be run as a Fly.io app, it is limited to a single region, making Upstash Redis a better fit due to its global replication capabilities and REST-based SDK that avoids connection issues in stateless runtimes. The text outlines the steps to create and deploy a basic Node.js application on Fly.io that accesses Upstash Redis, including setting up accounts, installing necessary tools, and modifying the application code to integrate with Upstash Redis. The deployment process involves launching the app locally and deploying it on Fly.io using the flyctl commands, with the option to monitor the application through Fly.io's dashboard. The article emphasizes the ease of using these technologies together to create scalable and globally accessible applications.
Apr 28, 2022 404 words in the original blog post.
Keepalive is a technique that reduces latency by maintaining an open connection between a client and a server, which is particularly beneficial when making multiple requests to the same server in quick succession. Although serverless functions like AWS Lambda and Vercel are stateless, they can temporarily hold state when a "hot" function is reused, allowing data or connections to persist between requests. By placing variables or objects like an HTTPS agent outside the handler function, subsequent invocations can reuse these resources, enhancing performance. Testing on a Next.js app with Vercel and an Upstash Redis database showed that enabling keepalive and caching connections significantly reduced latency, with initial requests taking longer due to connection establishment but subsequent requests achieving much lower latency. This optimization is realized in the @upstash/redis SDK, enabling keepalive by default to improve performance across multiple calls without additional configuration.
Apr 25, 2022 751 words in the original blog post.
A Node.js URL shortener app leverages Cloudflare Workers, Upstash Redis, and Kafka to manage URL redirection and track click events, integrating with Materialize for real-time data analytics. The app stores data in Upstash's serverless Redis as key-value pairs and logs click events in Upstash Kafka, which are then analyzed in real-time using Materialize's streaming SQL capabilities. Users can deploy the app by setting up the necessary Redis and Kafka clusters, configuring Cloudflare Workers via the wrangler tool, and integrating Materialize as a data source for real-time insights. Materialize, acting as a streaming database, allows users to perform SQL queries on live data with minimal latency, and offers compatibility with BI tools like Metabase for creating real-time dashboards. The setup provides a practical demonstration of utilizing serverless technologies and streaming databases for efficient data processing and visualization.
Apr 19, 2022 952 words in the original blog post.
The post describes the creation of a basic web application using Next.js that employs serverless computing to moderate user-submitted comments for inappropriate content before public display. The process involves sending comments to a Kafka topic, which then triggers an AWS Lambda function. This function uses the Sightengine API to assess the content's appropriateness, subsequently storing clean comments in a Redis list and inappropriate ones in a separate list. The application loads and displays these comments from Redis. The post also explains the rationale behind using Kafka for its versatility in data processing, allowing integration with various systems, and discusses the choice of AWS Lambda for its serverless architecture, although alternatives are possible. The example aims to demonstrate the ease of implementing complex systems using serverless tools.
Apr 18, 2022 1,652 words in the original blog post.
Leveraging open-source tools like Strapi, a headless CMS, can significantly streamline backend development by allowing teams to focus on app features without getting bogged down by backend implementation. Strapi's graphical interface facilitates data modeling, even for non-technical users, enhancing collaboration and efficiency. As user bases expand, developers can optimize performance by incorporating REST Cache with plugins that support caching solutions like Upstash Redis, which offers global replication and a serverless architecture. Setting up Upstash Redis is straightforward, requiring just a few clicks to create a database and integrate it with Strapi, ensuring that content is accessible quickly across the globe without overloading the database. By using Upstash Redis, developers can ensure quick data delivery, leveraging its serverless, pay-as-you-go model, which is particularly advantageous for scaling applications efficiently.
Apr 11, 2022 1,308 words in the original blog post.
Upstash has announced that its Redis databases are now compatible with Redis commands up to version 6.2, addressing previous limitations such as the absence of commands like GETDEL, LMOVE, and COPY, and features such as Access Control Lists (ACL) introduced in Redis 6. The new release includes a persistent ACL implementation where updates are immediately persisted and replicated to all replicas, and introduces the ACL RESTTOKEN subcommand for generating REST API tokens. Additional enhancements include new commands like BLMOVE, GETEX, and ZRANDMEMBER, and updates to existing commands such as AUTH, which now supports the ACL username parameter, and SET, which has new options like KEEPTTL and PXAT. Upstash is also preparing for upcoming changes in Redis 7.
Apr 10, 2022 357 words in the original blog post.
In this blog post, the author outlines a method for creating a serverless application that searches Twitter for specific keywords and publishes the resulting tweets to a Kafka topic using Upstash. The process involves setting up a Maven project with necessary dependencies such as Twittered for Twitter API access, Kafka-clients for Kafka interaction, Log4j for logging, and AWS Lambda for serverless computing. After creating a Twitter Developer account and setting up a TwitterProducer class to handle tweet searching and publishing, the application uses an AWS Lambda function to trigger the Twitter search every 15 minutes. The tweets are then published to a Kafka topic on Upstash, showcasing the ease of integrating serverless functions with Kafka to handle data streams. The post concludes with verification steps to ensure the tweets are being correctly published and consumed, demonstrating the efficiency of using Upstash's serverless Kafka offering in conjunction with AWS Lambda.
Apr 07, 2022 1,239 words in the original blog post.
Blitz.js, initially a fork of Next.js, is utilized to build a To-Do application that stores tasks in Upstash, a cloud-based Redis database. The process involves setting up the Blitz.js environment by installing necessary packages like TailwindCSS for styling and the Upstash JS SDK for API interaction. The application includes user authentication, allowing each user to have a private To-Do list, and involves creating API routes to add, retrieve, and remove To-Dos from the Redis database. The frontend is constructed using React Hooks and employs the Blitz.js framework's unique features like antiCSRF tokens to secure API requests. The main component, <Main/>, initializes the application's state, manages To-Do entries, and dynamically updates the UI based on user interactions. Users must be logged in to access the To-Do functionalities, and the application provides a user-friendly interface to manage tasks effectively. Blitz.js is evolving from its roots in Next.js, potentially leading to significant changes in the future, and the blog offers resources for further exploration and engagement with the community.
Apr 06, 2022 2,219 words in the original blog post.
This blog post details the process of building a React Native mobile application that tracks and logs user interactions by integrating Upstash Kafka and Upstash Redis. Upstash Kafka, a serverless Kafka service, is used to collect logs and errors generated by the app, while Upstash Redis stores item prices that the app retrieves and displays to users. The setup involves creating Kafka clusters and topics to handle different types of logs, such as errors and purchase activities, and configuring credentials for secure data production. The app demonstrates success and failure scenarios by sending logs to Kafka when users attempt to view item prices, showing alerts for successful retrievals, and logging errors when prices are unavailable. The integration is performed using HTTP requests with the upstash-kafka JavaScript library, ensuring efficient communication between the app and the serverless services.
Apr 04, 2022 1,086 words in the original blog post.