On Tue, Aug 4, 2009 at 1:13 PM, Bernd
Fondermann<bernd.fonderm...@googlemail.com> wrote:
> On Tue, Aug 4, 2009 at 06:24, Ashish<paliwalash...@gmail.com> wrote:
>> While implementing Presence Cache for Vysper, was wondering, is this
>> the only cache needed by Server?
>>
>> So, if other modules need caching, they may have to re-implement the
>> cache like Presence Cache.
>>
>> How about having Cache implemntation as part of Server and required
>> modules can either extend it or
>> use the global implementation.
>>
>> wdyt?
>
> There are a few things the server needs to have quick access to:
> rosters, active sessions, resource ids etc.
> Some XMPP extension mights needs this, too. They will have very
> specific requirements, though.
>
> "Caching" is an optimization strategy to improve throughput and scalability.
> Currently, we have no idea where we need to optimize, haven't we?

Yup it is. However, we have to start thinking about this. Well we know
how XMPP Server works and
we can atleast start putting our thoughts in place.

>
> What do you think would be the benefit of introducing such a "global
> implementation"? What would be its features and benefits?

Let me simplify it a bit. We have a cache implementation. How about
using the same implementation
by all. The user like presence, roster etc can just customize the way
they see cache.

Here is what I feel should be the requirements
1. CacheProvider - SPI like implementation to plugin custom caching
implementation. Our Server Users can choose what works best for them
2. Modules don't rewrite specific cache implementations, unless a
situation demands so. They rely on the global implementation. Please
note that global implementation doesn't means single cache. There can
be multiple cache's with or without replication. Even as of today we
use two cache instances for Presence, one based on Entity and other is
based on JID

The benefit is code reuse and ease of maintenance :-)

-- 
thanks
ashish

Reply via email to