<div class="gmail_quote"><div>Hello</div><div><br></div><div>for us Redis was a great solution for this problem: we run a kamailio based routing server that needs to handle millions of entries. mtree module worked great but it had a problem: after every change in the DB you need to perform a reload in order for the data to be in memory. For several million entires the reload took more than 3 minutes. That means that we needed to batch  many changes and do a reload every few minutes (it made no sense to do a full reload for a single change). We moved to redis an soon as the ndb_redis module was released. With redis we have these advantages:</div>
<div>-No reload needed, any change is instanly available (no batch either)</div><div>-We can access the same redis instance from several servers</div><div>-Using redis pipelining and unix sockets (Vicente provided a patch for using them in ndb_redis module), the performance is really astonishing.</div>
<div><br></div><div>The disadvantage is that you no longer have a mt_match funcion, you have to build it yourself. The same logic can be applied to other modules that rely on a db backend but need to be loaded into memory for speed. For small size data the reload is very fast, but when it starts growing it may take a while.</div>
<div><br></div><div>Regards</div><div><br></div><div>Javi</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Date: Fri, 15 Jun 2012 14:26:48 +0200<br>
From: Vicente Hernando &lt;<a href="mailto:vhernando@systemonenoc.com">vhernando@systemonenoc.com</a>&gt;<br>
Subject: Re: [sr-dev] [SR-Users]  New developer - Vicente Hernando<br>
To: &quot;Olle E. Johansson&quot; &lt;<a href="mailto:oej@edvina.net">oej@edvina.net</a>&gt;<br>
Cc: Development mailing list of the sip-router project<br>
        &lt;<a href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a>&gt;<br>
Message-ID: &lt;<a href="mailto:4FDB2A08.4090902@systemonenoc.com">4FDB2A08.4090902@systemonenoc.com</a>&gt;<br>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br>
<br>
On 06/15/2012 02:12 PM, Olle E. Johansson wrote:<br>
&gt; 15 jun 2012 kl. 13:45 skrev Vicente Hernando:<br>
&gt;<br>
&gt;&gt; Hello Olle,<br>
&gt;&gt;<br>
&gt;&gt; <a href="http://redis.io" target="_blank">http://redis.io</a><br>
&gt;&gt; <a href="http://en.wikipedia.org/wiki/Redis" target="_blank">http://en.wikipedia.org/wiki/Redis</a><br>
&gt;&gt; #redis  in <a href="http://irc.freenode.org" target="_blank">irc.freenode.org</a><br>
&gt;&gt;<br>
&gt;&gt; Redis is a non-SQL opensource network data store. It uses a key-value structure like a dictionary. Stores strings, and complex data tipes like sets, lists, etc.<br>
&gt;&gt;<br>
&gt;&gt; It is written in C.  Using hiredis library we can connect from kamailio to a running redis server. Kamailio module dealing with redis is named ndb_redis.<br>
&gt;&gt;<br>
&gt;&gt; Redis data is stored in RAM, and its goal is being very fast.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt; Ok. Thanks. But are there things you can do in Redis that can&#39;t be done in other databases?<br>
&gt;<br>
&gt; /O<br>
Actually, Redis is simpler than other databases. Its goal is speed. It<br>
tries to achieve high write and read speed.<br>
<br>
<a href="http://redis.io/topics/faq" target="_blank">http://redis.io/topics/faq</a><br>
<a href="http://redis.io/documentation" target="_blank">http://redis.io/documentation</a><br>
<br>
Regards,<br>
Vicente.<br>
<br>
&gt;&gt; Regards,<br>
&gt;&gt; Vicente.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On 06/15/2012 12:34 PM, Olle E. Johansson wrote:<br>
&gt;&gt;&gt; Vicente,<br>
&gt;&gt;&gt; Maybe you can take a moment or two and tell us old people about REDIS. What is it good for, how can it change how we use Kamailio?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I&#39;m curious.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Thanks!<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; /O<br>
&gt; ---<br>
&gt; * Olle E Johansson - <a href="mailto:oej@edvina.net">oej@edvina.net</a><br>
&gt; * Cell phone <a href="tel:%2B46%2070%20593%2068%2051" value="+46705936851">+46 70 593 68 51</a>, Office <a href="tel:%2B46%208%2096%2040%2020" value="+468964020">+46 8 96 40 20</a>, Sweden<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
<br>
<br>
<br></blockquote></div>