help me finish this thought:
“I bought this ‘Ecto in Production’ book to help me with … and learn more about …”
The book doesn’t exist (yet) but i wonder what it should contain.
help me finish this thought:
“I bought this ‘Ecto in Production’ book to help me with … and learn more about …”
The book doesn’t exist (yet) but i wonder what it should contain.
For one: A chapter about Ecto query plan cache.
By default Ecto caches query plans in a ETS table. Most times it is nice as now the planning-phase can be skipped saving some valuable time.
However, if the data in tables change the plan might not be optimal anymore and lead to worse results then having no cache.
There is an option to disable or influence the cache. When to set that option would be worth a section.
As this is probably never an issue in a dev environment; it’s perfect for a ‘in production’ book
Found a blog about it: Elixir and Postgres: A Rarely Mentioned Problem | Lainblog
wild. thanks for that example; I hadn’t seen that before.
tldr for others, Postgres might cache a query plan that is efficient for the first couple of queries and therefore decide to reuse it too much later when it’s less efficient-- but you can force it to use a custom query plan for each query to avoid this issue.
… migrating the database without killing production.
How to connect your instances together (distributed erlang), and how to do this for umbrella apps as well.
Libcluster is a great tool, but so much of this is still trial and error.
Although, maybe this is best approached via a series of blog posts?
I like all of the ideas above
Others that might be worth considering:
Also… in case you’re open to the idea, what about expanding the topic to ‘Elixir in production’? I think a LOT of people might be interested in that (esp if it’s published by someone like PragProg or Manning)
This sounds like “Elixir in Production” (also a wonderful book idea)-- is there an Ecto-oriented problem you’re facing here about connecting distributed instances to the database?
Arg, you are so right!
This isn’t an “Ecto” topic at all, in fact, I failed to process the discussion correctly and read it as “Elixir” instead of “Ecto”.
I blame my early start for my slow-running brain, specifically, the 6:30am meeting.
Sorry for the noise.