Knowledge Base
Guides, comparisons and how-tos from the Upstash team.
Railway Redis vs Upstash: Which Redis for Your Railway App?
If you have an app that's hosted on Railway and you want to use Redis for your cache, sessions, or for a queue, you can either add a Redis service to the Railway project with a few clicks, or use Upstash to provide a managed Redis database outside Railway. To connect your app to either Redis service, you'll need a standard Redis client, and a REDISURL environment variable.
How to Add Memory to an AI Agent with Redis
In order to add memory to an AI agent, you need to store things outside the model and load them into the prompt with every turn. When the model responds to your message, you need to write new things back to memory. For most agents, short-term memory (what you talked about most recently) and long-term memory (what you know about the user) are the most important.
Express Redis Cache: Add Upstash Redis to Any Node.js App
When an Express route reads from a slow database, every request waits for that query. A Redis cache keeps the result after the first request, so the next requests for the same data skip the database and take one round trip to Redis.
Thundering Herd Problem: How Cache Stampedes Happen and 5 Ways to Stop Them
Of course, a cache only protects your database as long as the key is present. If you have a highly-accessed key expire during a high traffic period, you’ll have a stampede of requests that miss all at once in the subsequent few hundred milliseconds. All of those requests will then fall back to the database, exposing the database to the load the cache was meant to prevent.
Web Application Caching: Browser, CDN and Server-Side Caching Explained
A product page, which always reads the same row from the database, pays thousands of times per day for the same query. Caching stores a copy of the result near the user, so subsequent requests don’t have to do the work. A web application has a few different places to cache the result, each of which has a different expiry rule and mechanism for eviction.