I was talking with someone about possibly using an in-memory database to make searching through the (±1.5 gigabyte of) data more efficient.
He asked me if I knew what impact the use of an in-memory database such as ETS would have on the startup (and therefore also restart) time of the application. I have not been able to find any information about this so far. Could someone explain to me what ETS does at startup and how much longer it will take your application to be fully started when you use it?
Just starting ETS and creating (reasonable amounts of) tables shouldn’t take any meaningful amount of time as far as I know. If you are importing lots of data to them at startup, you need to measure how long that takes.
I’m a bit confused by the question. ETS tables don’t survive application restart, so the size it is on shutdown doesn’t affect its size when you restart.
If you have some process for initializing the table then that is gonna be the relevant bit as I see it. You can do it sync or aync to your application boot process depending on whether it makes any sense to have stuff running on a partially initialized table.
Ah, I see. I did not realize that ETS tables are ephemeral (which of course makes a lot of sense).
So: Yes, the ETS table would need to be filled with data before the application could provide most of its functionalities, so it makes sense to do this during the boot process.
Maybe this whole question is somewhat nonsensical, as startup time is obviously something that only happens once, and therefore is much less important than per-request efficiency.