Hi guys,
I will need a cache system based on a Hashmap (ahash) that can be read from multiple processes on the system it is running on (Linux).
I want a login management for multiple apps on the system.
The basic idea, is a hashmap using a custom allocator, with proper locks, using a file as a mmap region to share the cache from multiple processes.
I already have a custom db that does this but the question is that I would like to reuse as much already existing pieces as possible.
I want to compare my custom solution with a custom hashmap.
Using a custom allocator should make it but I want the opinion of people with a better understanding of Rust than I do before doing anything.
The need:
- A shareable hashmap cache to multiple processes on the system
- Linux
- Use a file based mmap
- Enables me to write the allocation logic, locks..
- Reuse the ahash algorithm for the AES instruction
My current vision:
- I just finished writing a db that does exactly this, but I want a hashmap version to compare.
- I will write a custom allocator ( is it something stable enough or should I expect major hurdles
- Never wrote a custom allocator (for a std collection container) in Rust (but in other languages). I am a bit hesitant.
- If there is a slightly easier path / already done crate that does exactly this, I am all ears.
- performance will be reduced <-> synchronization: I am perfectly aware of the loss of performance, but shareability is paramount here. A fast hash could help a bit -> ahash.
- I could launch the apps in the same process and benefit from the shared memory here, but I may launch different apps at different time. So.. nope.
- I would like to avoid forking from Hashmap to rewrite anything. Too long. Reuse is the goal. I want to leverage the experience of experts.
I am asking for your vision, ideas, experience of what is expecting me with the borrow checker or anything.
Thanks guys