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

Reimplement Transactions without using Mnesia #64

Closed
whitfin opened this issue Sep 3, 2016 · 0 comments · Fixed by #70
Closed

Reimplement Transactions without using Mnesia #64

whitfin opened this issue Sep 3, 2016 · 0 comments · Fixed by #70
Assignees
Milestone

Comments

@whitfin
Copy link
Owner

whitfin commented Sep 3, 2016

Now that we're no longer using distribution via Mnesia, we should jump to using straight ETS tables.

This presents a challenge, because of transaction support, which we don't want to remove - so we need an implementation which functions in the same way (although we don't need to provide abort/1 I think), without using Mnesia.

This will take shape by using a special lock table per cache, which allows for either a global lock, or key locks. If the key being operated on is locked, then calls to that key just sit until it's ready. This needs heavy documentation to make it clear that this will block all calls (if you block the table, obviously).

There's naturally a slight performance hit to this even if you're not using transactions. Due to this, transactions should be a flag you can turn on or off. If they're disabled, then you can't use them (and thus there's zero hit). If it's enabled, you can use them, with the understanding that there's likely a couple of microseconds perf hit on every command. I haven't yet decided whether it should be enabled by default or not (I'm leaning towards not).

It's very possible that this won't ever be done/merged, due to complexity. Also, the above is a scramble of thoughts in my head - I'll neaten up the notes here once it's more solid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant