[OpenSIPS-Users] Cache design

jarrod at unixc.org jarrod at unixc.org
Tue Jan 12 21:10:37 CET 2016


John,

I do something similar for caching auth user id and passwords using cachedb_redis/cachedb_local and db_postgres.

My basic logic first checks cache (cache_fetch) to see if the key exists.  If it does I will pv_proxy_authorize using the value stored in the populated avp from the fetch.  If the cache does not exist, I will query Postgres (avp_db_query) and store (cache_store) the value in cache with a lifetime so that it will automatically repopulate at a later time.  The only time I may adjust the cache out of band would be if the user modifies their SIP password through the portal which causes the system to delete the stale key/value from the cachedb store.

This may or may not address your concern, but I hope it helps.

Jarrod

> On Jan 12, 2016, at 1:54 PM, John Nash <john.nash778 at gmail.com> wrote:
> 
> I am using local cache db module in order to keep user id and password in memory and now plan to keep some other data in memory too and that I want to keep in some centralized cache. 
> 
> It will be like Opensips1, Opensips2.... <-----> Cache server <---------> Postgresql
> 
> I also need to periodically update cache (using some mi commands may be)
> 
> I saw many of the modules related to cache in opensips (Like sql_cacher, cachedb_* , DB_CACHEDB)  and I am confused on what should I use for my need and how these are all related.
> 
> Any suggestions?
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users




More information about the Users mailing list