Home / Companies / Upstash / Blog / June 2021

June 2021 Summaries

3 posts from Upstash

Filter
Month: Year:
Post Summaries Back to Blog
Cloudflare Workers, introduced in 2017, allow developers to intercept and manipulate HTTP requests at the edge, using code snippets and KV storage for data handling. This post outlines how to implement an IP Allow/Deny list using Cloudflare Workers and Upstash Redis as a source of truth, demonstrating the process of retrieving a visitor's IP address from request headers and checking it against an allowed list stored in a Redis database accessed via REST API. The application requires a Serverless Redis Database, a Cloudflare account, and basic JavaScript and Cloudflare Workers knowledge. The implementation involves creating a Cloudflare Worker to intercept requests, fetching the visitor's IP, and making a REST API call to check if the IP is allowed, with Redis providing the flexibility of various client SDKs and command-line interfaces. The post concludes by highlighting the potential for this application to serve as a security measure, with the ability to update configurations within the Redis database, which can be read by the Cloudflare Worker.
Jun 18, 2021 635 words in the original blog post.
Cloudflare Workers, a leading edge computing product, enables developers to build globally distributed and performant applications by running applications closer to users without cold starts. It allows functions to be written in multiple languages while leveraging Cloudflare's global network to minimize latency. However, a challenge arises when connecting databases to serverless environments due to the need for persistent connections. Upstash addresses this with a REST API over Redis, allowing Edge functions to access Upstash efficiently. Compared to Cloudflare Workers KV, Upstash offers more advanced Redis data structures and faster write latencies. This integration is exemplified through a simple web analytics application that tracks user traffic at the Edge, recording requests in Upstash Redis and providing analytics data such as page views, unique visitors, and top countries. The Upstash Edge roadmap includes plans for Edge Caching and global replicated databases to further improve latency and data access consistency across multiple regions.
Jun 15, 2021 1,635 words in the original blog post.
Multi-zone replication capability enhances database high availability and scalability by replicating data across multiple availability zones, ensuring that applications remain unaffected by zone failures as requests are redirected to healthy zones, and reducing failover time from minutes to seconds. The architecture employs a single leader replication model where each key is managed by a leader replica, with backup replicas supporting write operations and providing read scalability, while the failure detection mechanism triggers a leader election when the current leader fails, causing minimal unavailability. Consistency is maintained through two modes: eventual consistency, which offers better scalability but may return stale data, and strong consistency, which ensures data safety and disk sync before responses but reduces scalability. Upgrades to multi-zone replication are managed via the Upstash Console with no downtime, though minor performance degradation may occur during migration, which varies in duration depending on the database size.
Jun 03, 2021 466 words in the original blog post.