Skip to main content
30 votes
Accepted

Why is Redis called an in memory database when it provides persistence?

Redis is an in-memory database because it keeps the whole data set in memory, and answers all queries from memory. Because RAM is faster than disks, this means Redis always has very fast reads. The ...
amon's user avatar
  • 135k
17 votes
Accepted

Microservices - sharing data through distributed in-memory cache?

Just like using a single database for multiple services, the approach you describe causes a strong coupling between the services. For example, you can not change the data model of one service without ...
Michał Kosmulski's user avatar
11 votes
Accepted

Different Redis instances for different microservices?

If we consider the cache to be orthogonal to the architecture (and it's), the first pic is ok. For the same reason that we don't deploy one security service, one API gateway, one message broker or ...
Laiv's user avatar
  • 14.7k
8 votes
Accepted

How to implement a message queue over Redis?

If you want to use Redis for a message queue in Node.js and you don't mind using a module for that then you may try RSMQ - the Redis Simple Message Queue for Node. It was not available at the time ...
rsp's user avatar
  • 7,858
8 votes

Different Redis instances for different microservices?

Separate services should use separate REDIS instances. Reason: Bad usage of REDIS by another service, causing REDIS outage, should not impact your application. Only queues which are used for inter-...
Sahil Gupta's user avatar
7 votes
Accepted

How is caching used within messaging apps?

I know that they store messages in cache... but wouldn't just a common database be enough? So at time of writing, Whatsapp has... north of 1.5 billion users (https://www.statista.com/topics/2018/...
Telastyn's user avatar
  • 109k
7 votes

Designing a microservice architecture

To meet this requirement, I need several microservices. Not really. You don't 'need' microservices at all. There may be good reason to decompose your architecture into smaller loosely coupled ...
JimmyJames's user avatar
  • 27.5k
5 votes

Using Redis as a cache in a Multi-Tenant application

After further research I am satisfied with an answer so I will answer my own post. I see that Microsoft recommends using a prepended-tenant (client ID in this case) in this particular article: https:/...
Brad's user avatar
  • 435
4 votes

Different Redis instances for different microservices?

Can you prevent that one service writes into the namespace of another service? If not, sharing one Redis instance breaks service separation. And soon Redis will be used as a way to sync data. Not to ...
Frank Hopkins's user avatar
4 votes
Accepted

Best way to reduce database writes?

Assuming that you really need this counter, does it really have to be constantly updated every time a user sends a message? Could you use a more "granular" counter which increments every ...
Alex D's user avatar
  • 1,308
4 votes
Accepted

What performance benefits does a Redis cluster have over having all machines connect to a single Redis node?

Redis clustering splits the cluster on two axis sharding, and replicas. Each shard is made up of one primary, and n secondary replicas. Multiple shards provide better aggregate write performance by ...
user1937198's user avatar
4 votes

Best way to store quite large JSON objects?

You have an interesting scenario with lots of solution that might be appropriate. You raise a good point that the amount of data might be an issue. As a worst case estimate, you might have 0.5MB per ...
amon's user avatar
  • 135k
3 votes
Accepted

How to think about queries in NoSQL

I don't understand your data model in sufficient design to give you concrete advice, but can provide a few pointers about combining databases. Using multiple databases is perfectly fine because you ...
amon's user avatar
  • 135k
3 votes

How to solve cache eviction when not using distributed cache in microservices?

Oh, the joys of distributed systems. There are two general approaches to this problem: You can keep using this caching strategy and accept that service A will usually get outdated data. This is just ...
amon's user avatar
  • 135k
3 votes
Accepted

Is my use case for Redis appropriate?

Cache can be used and will help here as many clients for events which will rarely change. Even if they change: updating a key, or deleting and adding it back lazily, works fine. For exactly how you ...
tgkprog's user avatar
  • 611
3 votes

Why is Redis called an in memory database when it provides persistence?

In other words, REDIS only uses the disk to warm up it's in-memory cache, in case the REDIS server goes down for whatever reason. You do not actually have to turn on persistence in REDIS. It is an ...
Neeraj Murarka's user avatar
3 votes
Accepted

Exploiting Apache Spark Data

Spark programs are just java, scala or python code, so they can write data to all the same places any program can write them. In fact, spark does not actually do anything unless you write the end ...
Joeri Sebrechts's user avatar
3 votes

Best way to reduce database writes?

I'd recommend to first start by doing the simplest thing of just incrementing a simple counter. For most applications, this is probably going to be sufficient and simple to implement. If you really ...
Lie Ryan's user avatar
  • 12.4k
3 votes
Accepted

Redis write-through cache vs write-behind cache (message queue?)

Your question is specific, so I'll answer it head-on first. I anticipate that "write-behind" cache will be better. "write-through" might help with occasional spikes in ingress data,...
Kind Contributor's user avatar
3 votes

Redis write-through cache vs write-behind cache (message queue?)

There are already very good answers. Here are my comments: Does a high-availability cluster with write-behind cache solve all of my problems? The design sounds reasonable. One thing worth testing in ...
lennon310's user avatar
  • 3,222
3 votes

Best strategy to flush Redis cache used in a distributed environment

I'm not sure i am understanding your problem correctly. But it sounds like you are simply using redis as an in memory db rather than a cache. ie you store all the records there all the time. This is ...
Ewan's user avatar
  • 77k
3 votes
Accepted

When does a REST API stops being one in terms of state management?

The statelessness in REST means that transaction state is not maintained between requests. for example say i have an eCommerce api where i can purchase a "basket" of items A Stateful API ...
Ewan's user avatar
  • 77k
2 votes

How to implement searchable persistent queues?

I think you're overthinking things. You can use a traditional SQL-based RDBMS. It may or may not be fast enough (although I suspect you're worrying prematurely about optimization), but the only way ...
Jules's user avatar
  • 17.8k
2 votes

How does Redis (or any typical distributed cache) handle replication conflicts?

Apologies for not knowing the official or real names. My hope is that someone comes along and edits my answer with the appropriate names. There's few options : Latest is Bestest - assume the ...
blr's user avatar
  • 399
2 votes

Should I partition my messages with channels or with content?

I think the channel approach is preferred over a group identifier. Clients should only subscribe to messages that are actually important to them. While this may lead to a lot of Redis channels and ...
Samuel's user avatar
  • 9,197
2 votes

Using NoSQL as MQ and for maintaining state

You don't provide enough information bout your system to recommend a solution. However, using a (two!) databases as a queue is less good than using a queue as a queue. In addition I would say you ...
Ewan's user avatar
  • 77k
2 votes

Architecture for distributed real time traffic capturing/viewer system

The DB will probably have performance issue since the capturing speed can be very high and viewer will constantly pulling data from it. Not to mention that you'll need an automated process to clean ...
kdgregory's user avatar
  • 5,250
2 votes

Design decision of reading XLSX file at once or intermittently

It's not possible to know for sure whether caching your data in Redis would be worthwhile without more information, but: Don't jump to the conclusion that you need to cache the data in Redis. Every ...
Alex D's user avatar
  • 1,308
2 votes
Accepted

Is it ok to use redis scan extensively?

Note Redis is single-thread, so any operation could block another. (It tried to address this issue in its recent release by delegating the time spent reading and writing to I/O sockets over to other ...
lennon310's user avatar
  • 3,222
2 votes
Accepted

Event Driven Architecture how should channels be used

In contrast to the regular MQ Brokers (Active MQ) or Event Logs (Kafka, Event hub) Redis Pub/sub is not persistent and does not hold a notation of things like transaction that can be found in an MQ ...
Alexander Petrov's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible