~/talk

ActiveRecord vs. Ecto: A Tale of Two ORMs

Talkat RailsConf 2016 · 2016-05-04..05-06· [ruby-on-rails]
slides:none on file

Compares a Rails ActiveRecord implementation of a Hallway Track app to an Elixir Phoenix/Ecto rewrite and shows concrete tradeoffs: ActiveRecord reads like English but produces preload causing N+1 and encourages seeing stars select problem*, spreading SQL across scopes; Ecto uses explicit Repo/schema/changeset/query, prevents N+1 by design, forces eager queries, uses Multi for transactional writes, runs tests concurrently on the Erlang VM, and yields fewer runtime surprises at the cost of more boilerplate.

AI-written summary · about

  1. 0:00Introduction
  2. 0:48What is Erlang
  3. 2:59What is Ecto
  4. 5:33Brads ORM journey
  5. 5:59Functional programming
  6. 7:07ActiveRecord
  7. 7:33Hallway Track
  8. 8:24ActiveRecord Setup
  9. 8:59ActiveRecord Controller
  10. 10:13ActiveRecord Preload
  11. 10:47leaky abstraction
  12. 11:46objectoriented programming
  13. 12:19query join
  14. 12:51seeing stars
  15. 13:41summary
  16. 15:25transaction management
  17. 16:12Rails ActiveRecord
  18. 16:48Word of the Day
  19. 17:02Phoenix
  20. 17:22Ecto Model
  21. 18:08Ecto Controller
  22. 18:59Repository Pattern
  23. 19:59No Save Method
  24. 20:34Struts
  25. 20:51Query
  26. 21:40Sequel
  27. 23:09Phoenix Council
  28. 24:36Change Sets
  29. 24:58Pipeline Operator
  30. 25:29Update Operator
  31. 26:25Multi
  32. 27:41Explicit
  33. 28:15Responsibility segregation
  34. 30:00Sequel syntax
  35. 30:59Sequel downside
  36. 31:53Sequel robot talk
  37. 32:15Explicitness
  38. 32:55Constraints
  39. 34:01Testing
  40. 35:10Ecto Adapters
  41. 35:33Tradeoffs
  42. 35:59Sequel ORM
  43. 36:15Trail Blazers ORM
  44. 36:27ActiveRecord ORM
  45. 36:44Resources
  46. 37:13Phoenix talk
  47. 37:23Who am I
  48. 37:40Where I work
  49. 38:06How we track
  50. 38:25Callbacks
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.