Boost logo

Boost Users :

Subject: Re: [Boost-users] Backend of multi_index container
From: degski (degski_at_[hidden])
Date: 2016-06-27 01:56:47


On 27 June 2016 at 07:27, Anaswara Nair <anaswara.nn_at_[hidden]> wrote:

> I have 7 fields in each record,two strings and five 64 bit integers. Of
> these,one of the integers is unique. I need to store all such records into
> the DB. In multi-index, I have a structure and this structure is being
> indexed by that integer value.
>

>From the docs: "The Boost Multi-index Containers Library provides a class
template named multi_index_container which enables the construction of
containers maintaining one or more indices with different sorting and
access semantics." You don't seem to need that functionality (and incurr
the cost of it).

> If I have to similarly create a structure and store it as the value in
> LMDB, then what is its difference from multimap? I can do the same in
> multimap also.
>

 There are plenty of differences (spelled out on the wiki page), but one of
them is concurrency (even at process level).

Then how does LMDB become a database.
>

What's a database? Depending how your indices are generated (randomly,
sequentially or otherwise, is size known in advance?), even a std::vector
could be your "database". You don't provide enough information.

I would suggest to first get your application to work in the simplest
possible way (i.e. std::multimap) and see whether that works for you. Don't
forget to also test against a std::unordered_multimap, as it could be
faster. If you need concurrency, have a look at the TBB library containers.

d.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net