<div dir="ltr">I personally like memcached because of it's speed and the availability of SDKs to work with it in so many languages. These are all good choices tho! I think the quantity and how frequently your data changes is a big factor. If you have a lot of data that tends to change, I'd use memcache. If it's a little data and not likely to change, I'd probably do db_text. The other thing to consider is that multiple opensips boxes can all talk to the same memcache versus db_text is per instance. <div><br></div><div>Let us know which way you go and if you have any questions!</div><div>-Brett</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Sep 22, 2020 at 10:42 AM Ovidiu Sas <<a href="mailto:osas@voipembedded.com">osas@voipembedded.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello Alain,<br>
<br>
If you don't want to run a full blown db, then you can use db_text<br>
without cacheDB.<br>
The data is cached into memory at startup. If you update the text<br>
file, you can re-cache the data [1].<br>
You can also manipulate the data using the avpops module [2].<br>
Or, you can use cacheDB on top of the text db :)<br>
<br>
[1]: <a href="https://opensips.org/docs/modules/3.1.x/db_text.html#mi_dbt_reload" rel="noreferrer" target="_blank">https://opensips.org/docs/modules/3.1.x/db_text.html#mi_dbt_reload</a><br>
[2]: <a href="https://opensips.org/docs/modules/3.1.x/avpops.html" rel="noreferrer" target="_blank">https://opensips.org/docs/modules/3.1.x/avpops.html</a><br>
<br>
Regards,<br>
Ovidiu Sas<br>
<br>
On Tue, Sep 22, 2020 at 9:36 AM Liviu Chircu <<a href="mailto:liviu@opensips.org" target="_blank">liviu@opensips.org</a>> wrote:<br>
><br>
> On 22.09.2020 16:09, Alain Bieuzent wrote:<br>
><br>
> I need to store some data locally but accessible by opensips.<br>
><br>
> the data is almost 20 records made up of a couple IP: name<br>
><br>
> From opensips script I want to retrieve the name associated with the IP (to put in place profiling).<br>
><br>
> how do you set up this kind of solution without accessing each call to an external database?<br>
><br>
> Hi, Alain!<br>
><br>
> One way would be to use the local cacheDB [1] module through the generic cacheDB scripting functions [2].<br>
><br>
> Alternatively, if you specifically need to load this data from an SQL DB, for example, the sql_cacher [3] module would be a perfect fit.<br>
><br>
> Fun Fact: if you decide to use any of these two modules, you will have to buy a guy named Vlad a beer, and they are not the same Vlad.<br>
><br>
> Best regards,<br>
><br>
> [1]: <a href="https://opensips.org/docs/modules/3.2.x/cachedb_local.html" rel="noreferrer" target="_blank">https://opensips.org/docs/modules/3.2.x/cachedb_local.html</a><br>
> [2]: <a href="https://www.opensips.org/Documentation/Script-CoreFunctions-3-2#toc4" rel="noreferrer" target="_blank">https://www.opensips.org/Documentation/Script-CoreFunctions-3-2#toc4</a><br>
> [3]: <a href="https://opensips.org/docs/modules/3.2.x/sql_cacher.html" rel="noreferrer" target="_blank">https://opensips.org/docs/modules/3.2.x/sql_cacher.html</a><br>
><br>
> --<br>
> Liviu Chircu<br>
> <a href="http://www.twitter.com/liviuchircu" rel="noreferrer" target="_blank">www.twitter.com/liviuchircu</a> | <a href="http://www.opensips-solutions.com" rel="noreferrer" target="_blank">www.opensips-solutions.com</a><br>
><br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
> <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br>
<br>
<br>
-- <br>
VoIP Embedded, Inc.<br>
<a href="http://www.voipembedded.com" rel="noreferrer" target="_blank">http://www.voipembedded.com</a><br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div>