Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Anyone uses boost::multiindex as a one-table database?

I need to maintain a 200 entries, 12 column table at extremely high speed, can I simply use boost multiindex to cutoff the sql overhead?

Has anyone ever tried to do this? What are the cons and pros of such a solution?

thanks

like image 890
James Bond Avatar asked Dec 06 '25 18:12

James Bond


2 Answers

A multi-index container will be much faster than a SQL table under certain circumstances:

  • Small amount of data relative to system memory
  • No need to load/store the container regularly
  • Queries/Indexes are known at compile time
  • You're willing to (or don't need to) handle thread-safety/atomicity

For best performance you will need to set up indexes on any fields you will be searching, obviously. If you need to look at multiple fields use a composite key, since you can't use two separate indexes together.

like image 145
Tim Sylvester Avatar answered Dec 08 '25 10:12

Tim Sylvester


If you no need to use T-SQL and you no need in benefits of full SQL server, then you could use multi_index with no problems. Additionally may be you will want to use custom allocator for your records (pool_allocator or something else).

like image 41
Kirill V. Lyadvinsky Avatar answered Dec 08 '25 11:12

Kirill V. Lyadvinsky



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!