Different than other Redis offerings, in Upstash persistence is always enabled. Every write operation is persisted to block storage provided by cloud providers (EBS in AWS case). This means an entry is stored in both memory and disk. A read is made from memory as long as the data exists in memory. Otherwise the data will be loaded from the disk.
Multi Tier Storage
Upstash keeps your data both in memory and disk. This design provides:
- Data safety with persistent storage
- Low latency with in memory access
- Price flexibility by using memory only for active data
An entry is evicted from memory if it becomes idle (not accessed for a long time). Eviction does not mean data loss as the entry already exists in the block storage. Upon a read operation the evicted entry is reloaded to the memory for fast access.
Can I use Upstash as a database?
Definitely, yes. Some users are worried that Redis data will be lost when a server crashes. This is not the case for Upstash thanks to Durable Storage. Data is reloaded to memory from block storage in case of a server crash. Moreover, the highly available Premium database provides extra redundancy by replicating data to multiple zones.