Question

I've been using stl for a while but i'm just getting to know sql.

Can sql functionality be simulated using stl/boost containers and algorithms? if not, where do the limitations start?

for example, I could create a database by simply using std::vector<std::unordered_map<std::string>> or even better with boost multi-index.

then, the sql operations can be mimicked with algorithms:

  • WHERE -- std::copy_if
  • JOIN -- std::set_union

It may be possible to do the optimization of the queries using lazy evalluation.

I do understand that sql is not in ram. but it's not that important if database is not that big. plus, there is also stxxl.

So my question is mainly about when do you stop using stl/boost and switch to sql?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top