dbern

dbern

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.

See Tweet

Showing Posts 1 to 8

BartOtten

BartOtten

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 :slight_smile:

Found a blog about it: Elixir and Postgres: A Rarely Mentioned Problem | Lainblog

11
Post #1
dbern

dbern OP

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.

https://github.com/elixir-ecto/postgrex/issues/497

Sebb

Sebb

… migrating the database without killing production.

joshknz

joshknz

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?

AstonJ

AstonJ

I like all of the ideas above :smiley:

Others that might be worth considering:

  • Scaling/optimisations
  • Security
  • Working with multiple databases
  • Working with legacy databases (such as when wanting to import data from a Rails DB into a new Phoenix app)
  • Working with apps built as separate components/applications (as per PragDave’s course)
  • Thoughts about using one big DB or splitting (perhaps linked to the above)
  • Creating an Ecto driver for new/other DBs
  • Transactions
  • Gotchas/things to look out for

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) :003:

dbern

dbern OP

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?

joshknz

joshknz

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.

— All posts loaded —

Where Next? Top

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 91898 914
New
AstonJ
The obligatory hello world thread! Who are you and where are you from? :stuck_out_tongue:
4616 55835 594
New
byu
@chrismccord : I just saw the Extract AGENTS.md from Phoenix.new into phx.new generator commit to the phoenix project. My initial shotgu...
New
arcanemachine
I was working on an Ecto migration and I needed a timestamp. So, for the nth time, I looked up the different data types for timestamps, a...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New
Herve37
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using. We’re particularly inte...
New
matt-savvy
Is there a word for the ~> symbol used in Version strings? Do you also just call it a Squiggle Arrow™ ?!
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews