Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login
Show HN: AllyDB – An in-memory database similar to Redis, built using Elixir (github.com) similar stories update story
20 points by Allyedge | karma 5 | avg karma 0.42 2023-02-19 18:04:33 | hide | past | favorite | 13 comments

Hey, everyone.

I am currently working on AllyDB, which is basically my own Redis, which I am writing in Elixir.

Currently, the database is nowhere close to being ready, as you can see in the roadmap, but I am doing my best to add stuff as fast as possible.

Currently the implementation is very simple, with an in memory table, an append log persistence system, as well as an interval persistence system as a backup.

The database could definitely be optimized further, especially when it comes to persistence, which I am planning to do in the future.

I'm also planning to use Rust NIFs for specific tasks for the performance gains over Elixir and BEAM.

Writes and deletes are currently asynchronous, but I will add blocking versions of them soon.

I am trying to make the system as fault tolerant as possible, and currently everything except the TCP connections are fault tolerant.

I'm also working on a TypeScript client for the project, so yeah, that kind of sums it up.

Feel free to check the project and the roadmap out, and let me know what I could improve or give feature or optimization ideas!

Thanks, and have a nice one!



view as:

Since this runs on Elixir, what's the advantage of using it over Elixir's inbuilt ETS?

The project uses no dependencies and uses ETS anyways.

I am just handling the harder parts such as persistence by myself, to let the user only worry about writing features instead of reinventing the wheel.


Hey OP, this is cool!

- What are the reasons you picked Elixir?

- What are you motivations for this project?

- How does the append log persistence work?

- Do you plan on adding clustering support?

- How do you plan to make it fault tolerant?

Here is the link to the roadmap if anyone is interested - https://github.com/Allyedge/allydb#roadmap


- I was just looking to build a database similar to Redis for practice, and thought Elixir's ETS and OTP would be useful.

- Just learning more about databases while building a Redis alternative.

- It appends operations, the same ones you write to the TCP client and when loading them, just runs those one by one. I will still add some optimizations for e.g. repetitive commands.

- I haven't thought much about it yet, feel free to start a discussion in the GitHub repository to further talk about that.

- Probably not crash the server but return more useful errors and use Elixir's OTP features.

Glad to hear that you liked the project!


I am working on a DB project [0] too, so I was excited to this!

Thank you for answering my questions, I wish you the best with the project

[0] - https://github.com/avinassh/go-caskdb


Thanks!

Your project looks very interesting as well.


Sounds like AlloyDB from GCP otherwise interesting project. There's been a few lately. Any benchmarks on how they compare?

The project is not finished yet so I didn't do many benchmarks, but if someone cares enough to write some, I would gladly include them in the project.

My testing gave me really fast writes and deletes (since those are asynchronous), and reads were around 60 nanoseconds per read.

But it depends on the data type and I am planning to add more optimizations, especially with Rust NIFs anyways, so I will wait a bit before actually talking about the pure performance of the DB.

The name is like AlloyDB, yeah, but I use that "prefix" in most my projects so, not much I can do there, haha. :)


Cool. Is it possible to run this inside another elixir app?

Not yet, but I plan to add that ability once the database is a bit more complete, which shouldn't take too long.

Bad name. Too close to AlloyDB. Cross the Rubicon and rename it.

LFP


It is true that it is similar, but I like including my username "prefix" in my project names so unless I get a great idea for a name, I plan to keep it the same way.

Legal | privacy