I am writing a bittorrent tracker in erlang. Given the nature of the service, I do not need absolute consistency (i.e., the Client can be completely satisfied with a slightly outdated peer list or torrent status).
My strategy so far has been to create mnesia tables in RAM with disc_copies enabled, so that mnesia automatically deletes disk memory when the log size exceeds a certain size.
If the server crashes, some information will be lost. Not really.
Another approach would be to indicate two tables (only one drum and only one disk) and to have a copy of the process from ram to disk every minute or so. This is more naive, but it allows you to reset only part of what is in memory, reducing the total load on the disk and possibly avoiding the use of the log at all (I'm not really sure about this last statement).
I am sure there are many other ways to do this. What's yours
-teo
source
share