Skip to content
whichdevtool?
Categories ▾

Frameworks and UI

Frontend and full-stack frameworks Backend frameworks UI component libraries

Hosting

VPS and cloud servers App hosting and PaaS

Data

Managed databases File and object storage ORMs and database toolkits

AI

AI model APIs

Email

Transactional email APIs Email marketing and newsletters

Payments

Payments and billing

Domains and edge

Domain registrars CDN, DNS and edge security

Operations and identity

Monitoring, uptime and error tracking Auth and identity Background jobs, queues and workflows
Stacks Directory
Ctrl K

Search directory
Menu
StacksDirectory Pricing changes Glossary
VPS and cloud servers App hosting and PaaS Managed databases Transactional email APIs Email marketing and newsletters Domain registrars CDN, DNS and edge security Monitoring, uptime and error tracking Auth and identity Frontend and full-stack frameworks Backend frameworks UI component libraries AI model APIs File and object storage Payments and billing Background jobs, queues and workflows ORMs and database toolkits
  1. Home
  2. ORMs and database toolkits
  3. Ecto
Ec

Elixir data mapping and query toolkit · by Elixir Ecto team

Ecto

Elixir's standard database toolkit: repositories, schemas, composable queries and changesets for validation, with ecto_sql adding migrations and adapters for PostgreSQL, MySQL, SQL Server and SQLite.

Visit hexdocs.pm ↗ Alternatives Open source Open source Self-hostable
hexdocs.pm
Ecto homepage
§1

Overview

Ecto has been developed since 2013, and its most active contributor on GitHub is josevalim. The docs split it into four parts: Ecto.Repo (where the data is), Ecto.Schema (what the data is), Ecto.Query (how to read it) and Ecto.Changeset (how to change it). Queries are written with Elixir macros, either keyword style (from w in Weather, where: ...) or piped (Weather |> where(city: "x") |> limit(10)), and are composable and parameterised.

There is no lazy loading or automatic change tracking: associations are preloaded explicitly and every insert or update passes through a changeset, which casts and validates input and records exactly what changes. This makes database access visible in code, at the cost of some extra typing compared with Active Record ORMs.

Most apps add ecto_sql, which provides SQL adapters (Postgrex for PostgreSQL, MyXQL for MySQL, Tds for SQL Server; ecto_sqlite3 for SQLite, and community adapters such as ClickHouse) and versioned migrations. Phoenix generators create Ecto schemas, migrations and contexts. Version 3.14 is current on HexDocs.

§2

Pricing and plans

Plan Price What you get
Ecto $0 Apache 2.0 licence

Free and open source under Apache 2.0; there is no paid product.

Source: github.com/elixir-ecto/ecto · prices as published, excluding tax.

§3

What it does

Repo
Wraps the database connection and pool; all reads and writes go through it.
Schemas
Map tables (or any external data) to Elixir structs with typed fields and associations.
Composable queries
Keyword and pipe syntax built from macros, checked at compile time for syntax and safe from injection.
Changesets
Cast, validate and constrain changes before they reach the database, with errors ready for forms.
Migrations (ecto_sql)
Versioned migration modules with up/down or reversible change functions.
§4

Strengths and limitations

Strengths

  • Explicit data access with no hidden lazy loading
  • Changesets give a clean, reusable validation layer
  • Tight Phoenix integration and generators
  • Very small open issue count; carefully maintained

Limitations

  • Associations must be preloaded explicitly, which is more code than lazy-loading ORMs
  • Elixir-only
  • SQLite and ClickHouse adapters come from separate projects rather than ecto_sql itself
  • Learning curve for developers used to Active Record-style ORMs
§5

Who it suits

Good for

  • Phoenix web applications
  • Elixir services that need clear, validated writes
  • Teams that value explicit database access

Look elsewhere if

  • Non-Elixir stacks
  • Developers who want lazy-loaded associations
§6

Alternatives to Ecto

Tool From Free option Stages
EO
Eloquent ORM Active Record ORM for Laravel
— Open source
AR
Active Record (Rails) Active Record ORM for Ruby on Rails
— Open source
Bu
Bun (Go ORM) SQL-first Go ORM
— Open source
Ky
Kysely Type-safe TypeScript SQL query builder
— Open source
Prisma ORM Schema-first TypeScript ORM
$10/mo Free tier
SQ
SQLx Async Rust SQL toolkit
— Open source

All ORMs and database toolkits →

§7

Questions

Is Ecto an ORM?

It is a data mapping and query toolkit; it maps data to structs but has no lazy loading or implicit change tracking.

Which databases does Ecto support?

PostgreSQL, MySQL and SQL Server through ecto_sql adapters, SQLite through ecto_sqlite3, and others such as ClickHouse through community adapters.

How do migrations work in Ecto?

The ecto_sql package provides versioned migration modules run with mix ecto.migrate.

Sources read for this page

  • https://hexdocs.pm/ecto/Ecto.html
  • https://github.com/elixir-ecto/ecto
Spec sheet
From
Open source
Free tier
Free to self-host
Stages
HobbyIndieStartupScale-upEnterprise Suits hobby, indie, startup, scale-up
Language
Elixir
Approach
Data mapper with query DSL and changesets
Databases
PostgreSQL, MySQL, SQL Server, SQLite, ClickHouse
Migrations
Yes, versioned migrations via ecto_sql
Open source
Yes
Self-host
Yes
EU data
Not stated
Category
ORMs
Visit hexdocs.pm ↗

To report an out-of-date price or limit, use the correction form.

whichdevtool?

Developer and cloud tools compared on price, free tier and limits, each with its source. For side projects, solo developers and small teams.

Categories

  • VPS and cloud servers
  • App hosting and PaaS
  • Managed databases
  • Transactional email APIs
  • Email marketing and newsletters
  • Domain registrars
  • CDN, DNS and edge security
  • Monitoring, uptime and error tracking
  • Auth and identity
  • Frontend and full-stack frameworks
  • Backend frameworks
  • UI component libraries
  • AI model APIs
  • File and object storage
  • Payments and billing
  • Background jobs, queues and workflows
  • ORMs and database toolkits

Research

  • Directory
  • Stacks by project
  • Developer news
  • Pricing changes
  • Glossary

Site

  • About and methods
  • How we make money
  • Suggest a tool or fix
  • Privacy
© 2026 whichdevtool.com Prices change. Each tool page links to its source. We may earn a commission when you sign up through links on this site. How we make money