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

atomicity and db operation concerns #40

Open
sean-roberts opened this issue Jan 25, 2017 · 2 comments
Open

atomicity and db operation concerns #40

sean-roberts opened this issue Jan 25, 2017 · 2 comments

Comments

@sean-roberts
Copy link
Collaborator

So as a few people have brought up, we are mimicking locking in our pushView util function which seems to be doing the db adapter's job. For example, if a db solution supports a "add or increment" function or handles atomicity cross process, then we are introducing a performance bottleneck by having all adapters use our locks logic and 2-3 transaction inserts. For the record, I think it was a really good starting point but we should take it to the next level.

So, I think that the next phase of our adaptors, while there are only two, need to support the API that we provided but the put needs to be changed. If they need to manually call their this.has() and this.get() to reconcile what they need to do, then go for it, but we shouldn't force that. So we should change put (or possibly rename it) but we should give them the key and they need to resolve a promise with the count value.

What do you think?

@mxstbr
Copy link
Member

mxstbr commented Jan 28, 2017

Yeah, that makes sense imo. What do you think @relekang?

@relekang
Copy link
Member

Sounds good to me 👌 It allows for much more custom optimisation for each adapter.

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

3 participants