3 ms·
How are you accomplishing that? Most databases take at least that long to get data back to your application.
by davidw 10y ago
How are you accomplishing that? Most databases take at least that long to get data back to your application.
- Arcsech 10y agoNot every API needs to hit a database for every call. This is especially true for Elixir/Phoenix because if you don't need your data to be persistent over a server failure, you can just store it in an OTP process/ETS table and keep it in memory.
- losvedir 10y agoNot necessarily. If the data is in the database's cache it can be pretty fast. I just tried `explain analyze select email from users where id = 10` on my local postgres, and while the first query took 20ms, the second one only took 0.065ms.
- quaunaut 10y agoIt's also worth pointing out, the newest Ecto(released this week) has features that can do multiple database calls at once, since each one is put into its own connection pool and then assembled at the end. So even rather heavy calls get effectively zeroed-out.