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

Redis as CRL manager #25

Closed
Pe46dro opened this issue Jan 26, 2022 · 2 comments
Closed

Redis as CRL manager #25

Pe46dro opened this issue Jan 26, 2022 · 2 comments

Comments

@Pe46dro
Copy link

Pe46dro commented Jan 26, 2022

I made a try to implement a CRL manager with Redis instead of lowdb and the performance i think is even better than MongoDB, I think that you should give a try.
On windows i used memurai as Redis replacement.

[...]
  async setUp() {
	const client = createClient();
	client.on('error', (err) => console.log('Redis Client Error', err));
	await client.connect();
	this._db = client;
  }

  async storeRevokedUVCI(revokedUvci) {
	for (const element of revokedUvci) {
		this._db.set(element, 'true');
	}
  }

  async isUVCIRevoked(uvci) {
    return await this._db.get(uvci) || false;
  }

  async clean() {
	return await this._db.sendCommand(['FLUSHDB']);
  }

I also would like to report an issue on the custom CRL manager example:

return !!await this._db.get('uvcis').find(uvci);

as it should be:

 return !await this._db.get('uvcis').find(uvci); 
@Elius94
Copy link

Elius94 commented Jan 27, 2022

Hi! also for me it works only with

return !await this._db.get('uvcis').find(uvci); 

@astagi
Copy link
Member

astagi commented Jan 27, 2022

Thank you @Elius94 @Pe46dro I’ll fix it!

@Pe46dro I usually store cache and volatile data on Redis and persistent data on db like MongoDB or PostgreSQL. Anyway I agree with you, Redis is way faster than MongoDB. Why not writing a plugin for VerificaC19 SDK and publish it on NPM? It could be used by developers in place of MongoDB CRL Adapter.

@astagi astagi closed this as completed May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants