jsm

jsm

ModuleStore - use a compiled module as a high-performance key-value store

Package: module_store | Hex
Source: GitHub - juulSme/ModuleStore: Compiled-at-runtime modules as high-read-performance key-value stores in Elixir · GitHub
Docs: ModuleStore v0.0.1 — Documentation

I’ve created a small library that (mis)uses module (re)compilation to create very fast runtime storage. It performs extremely well for reads and extremely badly for writes, by design. The API is a simple key-value interface. It should be considered as being in a very early state, it’s not battle-tested at all at this point.

https://github.com/juulSme/ModuleStore

Most Liked

wojtekmach

wojtekmach

Hex Core Team

For some more prior art, also check out GitHub - discord/fastglobal: Fast no copy globals for Elixir & Erlang. · GitHub. But yeah, I believe persistent_term was designed to solve problems like these.

ltd

ltd

Is there a reason to not use the erlang builtin :persistent_term.

https://www.erlang.org/doc/apps/erts/persistent_term.html

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

To be clear modules are also global. If you want a similarly ergonomic API you could just write a wrapper function around the persistent term lookup. As someone’s done a lot with compiled modules in Absinthe persistent term is just so much better.

Last Post!

jsm

jsm

The benchmark file is included in the source under bench, maybe I mucked it up somehow? I deliberately tried to keep it simple though. 100 pairs for every type of storage, take only the 50th atom key as quickly as you can.

Where Next?

Popular in Announcing Top

Crowdhailer
Experimenting with this code. OK.try do user <- fetch_user(1) cart <- fetch_cart(1) order = checkout(cart, user) save_orde...
New
jakub-zawislak
Hi everyone, I’m coming from the Symfony (PHP) framework. I like Phoenix, but it has a one thing that was build much better in the Symfo...
New
Crowdhailer
Raxx is an alternative to Plug and is inspired by projects such as Rack(Ruby) and Ring(Clojure). 1.0-rc.1 is now available. To use it re...
New
pkrawat1
Hey guyz We at @aviabird are working on a payment library in elixir/phoenix. We are targeting March 2018 to add 56 Gateways to it. Have...
New
wfgilman
I’ve cleaned up and open sourced three financial libraries I was using for my company. They are bindings for the APIs of these three comp...
New
mathieuprog
Hello :waving_hand: Allow me to introduce you to Tz, an alternative time zone database support to Tzdata. Why another library? First a...
New
scohen
Lexical Lexical is a next-generation language server for the Elixir programming language. Features Context aware code completion As-you...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31586 112
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 40165 209
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New

We're in Beta

About us Mission Statement