Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache should be multi application safe #178

Open
yurem opened this issue Jan 23, 2020 · 2 comments
Open

Cache should be multi application safe #178

yurem opened this issue Jan 23, 2020 · 2 comments
Assignees
Milestone

Comments

@yurem
Copy link
Contributor

yurem commented Jan 23, 2020

There are at least 3 applications now which reuses same cache implementation. All of them put data into same caching server or DB. This can led to key conflicts. We need to add key prefix for each application.
Also another aspect is data clean up. Now 3 applications trigger NativePersistence cache clean up to do global clean up. We need to allow to do clean up only application keys.

@yurem yurem added this to the 4.2 milestone Jan 23, 2020
@yurem
Copy link
Contributor Author

yurem commented May 27, 2020

This issue becomes priority. We have few apps which reuse cache classes. As result cleaner job can't clean specif service data. It do global clean up.

For me each cache entry should have appllication_id attribute. Also if DB supports tree based model we need to use base DN like this:
ou=application_id,ou=cache,o=gluu.

For DB which support tree based model we can use base DN. For rest DB we can use new attribute to find application specific entries.

@yuriyz
Copy link
Contributor

yuriyz commented May 27, 2020

I'm not sure how additional attribute is going to help to make cache application safe.
If let say we have scope DN, key would be the same for both oxauth and oxtrust for example (CB). Thus it may overwrite each other (with underlying attributes). We can unify it by prefixing key with additional symbol for example. Then for different apps even with same key underlying CacheService will make it different/translate (depending on ApplicationType).
E.g. DN scope1 for oxauth would be ascope1 and for oxtrust tscope1 (or maybe add it as suffix scope1a/scope1t). The drawback is that we double some entries while in reality it is same data.
Re: independent clean up, for Couchbase we have TTL. Open question is only for LDAP (tree based persistence). I guess idea of ou=oxauth,ou=cache,o=gluu should work.

@yuriyz yuriyz modified the milestones: 4.2, 4.3 May 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants