Questions tagged [dets]
17 questions
7
votes
0 answers
setup/teardown dets tables between each test in elixir?
We are trying to run each test in a completely clean dets environment, and each test is responsible for its own setup. We're running into issues where we can not completely remove the directory between tests.
How can we reset dets? Did we…

Tom Clearingbear
- 97
- 10
4
votes
3 answers
Mostly read only use of DETS
So I have been using ETS - works great. However, I use it as a cache of route data - which I load when the module loads, and save when a change is made (it is read far more than written).
I was thinking that DETS would make things much cleaner - I…

Michael Neale
- 19,248
- 19
- 77
- 109
4
votes
5 answers
Suitable data storage backend for Erlang application when data doesn't fit memory
I'm researching possible options how to organize data storage for an Erlang application. The data it supposed to use is basically a huge collection of binary blobs indexed by short string ids. Each blob is under 10 Kb but there are many of them. I'd…

Ilya Martynov
- 396
- 1
- 8
4
votes
1 answer
Clojure equivalent of Erlang's DETS / Persistent-Maps
I'm looking for the equivalent of Erlangs DETS for a persistent key/value store,
except with out DETS 2G table size limit.

Arthur Ulfeldt
- 90,827
- 27
- 201
- 284
4
votes
3 answers
How big can Erlang DETS be and what to do if its too small?
All I need is a large persistent lookup table in Erlang and dets seems like just the thing though I need a definative answer to:
just how big the total size of the binaries in the table can be.
how big each entry can be
what to do if the answer…

Arthur Ulfeldt
- 90,827
- 27
- 201
- 284
3
votes
1 answer
Will dets perform disk readings on lookup with ram_file option?
An option ram_file is described in DETS Erlang docs
open_file(name, args)
{ram_file, boolean()} - Whether the table is to be kept in RAM. Keeping the table in RAM can sound like an anomaly, but can enhance the performance of applications that open…

Drilla
- 109
- 8
2
votes
2 answers
How to examine DETS on a live application?
I'm new to Erlang, but I was wondering if it's possible to somehow attach to a working application and examine a ETS or DETS it's using. If yes, would you care to give a small example?
Thank you!

Andrey Panin
- 23
- 6
2
votes
1 answer
How to delete DETS file?
I'm having problem with DETS file, I cannot find functionality how to complete delete DETS file from my drive. Let's demonstrate scenario, you create DETS file insert one element and then you want to destroy that file as temporary but persistent…

Martin Bodocky
- 651
- 1
- 5
- 16
1
vote
1 answer
How to close a dets table correctly after some operations in erlang?
I have a function which checks if the given username already exists in the dets table or no :
is_username_web2_exists(Username)->
dets:open_file(?FILE_PATH),
case dets:lookup(?FILE_PATH,Username) of
[_] -> true;
_ -> false
…

Ahlem Salhi
- 11
- 6
1
vote
2 answers
Why dets file_size doesnot reduce after deleting all the keys
I am having problems with the size of dets file.
> {ok,D1} = dets:open_file(sample_dets_file, [{type, set},{auto_save,3}]).
{ok,sample_dets_file}
> [dets:insert(D1,{{fid,X},"this is sample data"}) || X <- lists:seq(1,10000)].
>…

SameeR
- 21
- 2
1
vote
2 answers
Dets leaves open process when test fails with EUnit
I have been playing with EUnit, it is nice but I'm running into issue with dets, when my test failed and haven't properly closed dets, the file is still open in my shell and I cannot close it because it was created by another process(when i ran…

Martin Bodocky
- 651
- 1
- 5
- 16
1
vote
1 answer
Erlang: should I keep dets open and under supervision?
I'm moving data in and out of dets and, I have a choice: I can either:
1) open dets immediately before accessing it and close it immediately after, or
%% Based on Armstrong, Programming Erlang, page 279
open() ->
File = ?NAMEDB,
case…

Lloyd R. Prentice
- 4,329
- 3
- 21
- 31
1
vote
2 answers
Random bad_object_header mnesia/dets error
I am having a very weird error with mnesia. I have about 10 tables that mnesia is recording, and usually it works fine. However, in a certain place in my code, whenever I try to read from a particular table (trying to read from other tables is fine)…

Johnny Test
- 107
- 1
- 7
0
votes
2 answers
dets example importing data
got a problem with dets:to_ets/2
Could somebody point me to an example online? Ive looked at the man pages but I couldnt see any example usage. Couldn't find anything on google..
My problem seems to be with the actual dets:to_ets() function itself,…

user997112
- 29,025
- 43
- 182
- 361
0
votes
3 answers
How to store a map using :dets in Elixir?
I want to be able to store a map using :dets
Currently, that is the solution I am trying to implement:
# a list of strings
topics = GenServer.call(MessageBroker.TopicsProvider, {:get_topics})
# a map with each element of the list as key and an…

Radu Aramă
- 195
- 1
- 1
- 10