Multi tenant application on Redis

2,146 views
Skip to first unread message

bugant

unread,
Jun 7, 2013, 9:50:44 AM6/7/13
to redi...@googlegroups.com
Hi there,
I was looking for the best way to serve a multi tenant application on Redis.

I came across this post
https://groups.google.com/d/topic/redis-db/u1IgtiWN0Ww/discussion from
2011.

There both Peter
(https://groups.google.com/d/msg/redis-db/u1IgtiWN0Ww/P8_Qr6hbmXsJ)
and Josiah (https://groups.google.com/d/msg/redis-db/u1IgtiWN0Ww/9I55i_dd9YQJ)
suggest to not use multiple dbs in the same Redis instance.

There seems that the best choice would be to use different Redis
process per each tenant
(https://groups.google.com/d/msg/redis-db/u1IgtiWN0Ww/ES30iOg8HykJ).

How does this scale with the number of tenants?

Cheers,
matteo.

Matt Palmer

unread,
Jun 7, 2013, 5:43:47 PM6/7/13
to redi...@googlegroups.com
On Fri, Jun 07, 2013 at 03:50:44PM +0200, bugant wrote:
> Hi there,
> I was looking for the best way to serve a multi tenant application on Redis.
[...]
> There seems that the best choice would be to use different Redis
> process per each tenant
> (https://groups.google.com/d/msg/redis-db/u1IgtiWN0Ww/ES30iOg8HykJ).
>
> How does this scale with the number of tenants?

Quite well. Redis itself has an extremely small memory footprint, and
automation to deploy a redis-per-tenant is a very small increment on top of
the work to automate the rest of the per-tenant deployment.

- Matt

Josiah Carlson

unread,
Jun 7, 2013, 6:29:09 PM6/7/13
to redi...@googlegroups.com
If you are planning on using Redis cluster, then multiple databases are a bad idea (they aren't supported).

If you are not planning on using Redis cluster, you can use multiple databases, but each additional database adds overhead during runtime. The default 16 databases aren't bad, but I'd hesitate using more than 100 (some people use hundreds).

That said, using multiple Redis instances is a viable and reasonable solution.

 - Josiah



--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.



Yiftach Shoolman

unread,
Jun 8, 2013, 10:32:42 AM6/8/13
to redi...@googlegroups.com
Just remember that if you use multiple DBs on the same Redis instance (process), you potential create a blocking scenario where one DB can block other DBs from executing commands, as Redis is based on a single threaded architecture.

--

Yiftach Shoolman
+972-54-7634621

Yiftach Shoolman

unread,
Jun 27, 2013, 8:10:46 AM6/27/13
to redi...@googlegroups.com
FYI - just to close the loop, this blog post compares the performance of a shared and a dedicated Redis instance 
--

Yiftach Shoolman
+972-54-7634621

bugant

unread,
Jun 27, 2013, 9:01:51 AM6/27/13
to redi...@googlegroups.com
On Thu, Jun 27, 2013 at 2:10 PM, Yiftach Shoolman
<yiftach....@gmail.com> wrote:
> FYI - just to close the loop, this blog post compares the performance of a
> shared and a dedicated Redis instance

Thank you very much! It's been a really interesting read.
So, the right thing to do will be for sure to have a Redis instance per tenant.

Thank you,
matteo.
Reply all
Reply to author
Forward
0 new messages