DEV.co
Open-Source Databases · vapor

fluent

Fluent is a Swift ORM library for the Vapor web framework that abstracts both SQL and NoSQL databases. It provides an intuitive API for defining models, building queries, and managing relationships in server-side Swift applications.

Source: GitHub — github.com/vapor/fluent
1.4k
GitHub stars
176
Forks
Swift
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositoryvapor/fluent
Ownervapor
Primary languageSwift
LicenseMIT — OSI-approved
Stars1.4k
Forks176
Open issues25
Latest release4.13.0 (2025-09-25)
Last updated2026-02-10
Sourcehttps://github.com/vapor/fluent

What fluent is

Fluent is a Swift-based ORM built on FluentKit, integrating deeply with Vapor's application lifecycle and dependency injection. It supports multiple database backends through a unified query interface and includes authentication mapping helpers for Vapor's auth APIs.

Quickstart

Get the fluent source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/vapor/fluent.gitcd fluent# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Vapor web applications requiring multi-database support

Fluent's database abstraction layer allows projects to query SQL and NoSQL databases through a consistent API, reducing boilerplate and enabling future database migrations without major refactoring.

Server-side Swift applications with complex data relationships

Fluent's relation management (one-to-many, many-to-many, etc.) and query builder are designed for applications requiring expressive data modeling and eager-loading strategies to avoid N+1 problems.

Swift-native backends prioritizing type safety

As a Swift-first ORM, Fluent leverages Swift's strong type system and compiler checks, reducing runtime errors and providing IDE autocomplete for database operations across the entire stack.

Implementation considerations

  • Fluent models require explicit migration definitions; plan data model evolution carefully before production, as schema changes must be versioned and tracked.
  • Query performance varies by backend; test eager-loading and indexes on your target database(s) to prevent N+1 queries and slow joins in production.
  • Swift's compile-time type checking reduces errors, but debugging runtime query issues requires familiarity with Fluent's query DSL and underlying FluentKit behavior.
  • Authentication integration requires understanding Vapor's auth APIs; plan user model and session strategy early to avoid rework.
  • Dependency on Vapor's lifecycle and dependency injection container; teams must adopt Vapor conventions to avoid architectural friction.

When to avoid it — and what to weigh

  • Your team is not committed to Swift — Fluent only works in Swift. If your backend must support Python, Node.js, Go, or other languages, this ORM is unsuitable; consider a polyglot-friendly solution instead.
  • You require database-agnostic ORM portability across frameworks — Fluent is tightly integrated with Vapor. Switching frameworks later requires significant refactoring; if future portability is critical, evaluate loosely-coupled ORMs or raw query builders.
  • Your project has high performance requirements with legacy databases — Fluent abstractions may not expose all database-specific optimization features (indexing strategies, query hints, etc.). Projects needing fine-grained control should use lower-level database drivers.
  • The Vapor ecosystem is immature or underdeveloped for your use case — While Vapor is solid, it has a smaller community than Node.js/Express or Django. If critical integrations (payment processors, analytics, specialized services) lack Vapor support, integration costs may be high.

License & commercial use

Fluent is licensed under the MIT License, a permissive, OSI-approved open-source license with no copyleft restrictions.

MIT License permits unrestricted commercial use, modification, and distribution. No proprietary or commercial use restrictions apply. However, verify your Vapor dependencies (database drivers, middleware packages) for their own license terms before deploying to production.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationStrong
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

Fluent uses parameterized queries by default, mitigating SQL injection in standard usage. However, security posture depends on correct ORM usage (avoid string interpolation in queries), database driver vulnerabilities, and access control at the application layer. Conduct threat modeling for sensitive data (PII, payments) and ensure proper authentication/authorization is implemented in Vapor handlers, not relied upon in ORM alone.

Alternatives to consider

Diesel (Rust)

If switching to Rust for performance or memory safety, Diesel is a compile-time-checked ORM. Requires a Rust backend, not a Swift one.

SQLAlchemy (Python) + FastAPI

Mature, widely-adopted ORM with extensive third-party integrations. Choose if your team prefers Python's ecosystem and don't need to be Swift-native.

Prisma (Node.js, Go, Rust, Python)

Modern, polyglot ORM with strong type safety and auto-generated client. Preferred if you need framework/language flexibility and don't require Swift-only tooling.

Software development agency

Build on fluent with DEV.co software developers

Fluent is ideal for Swift teams building Vapor applications with complex data models. Evaluate driver support for your database and test migrations before production. Need help assessing fit? Connect with our engineering team.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

fluent FAQ

Does Fluent support migrations and schema versioning?
Yes. Fluent includes a migration system for versioning schema changes. Migrations are tracked in the database and can be applied or rolled back; plan your migration strategy before production launch.
Can I use Fluent without Vapor?
Fluent is designed for Vapor integration. While FluentKit (the underlying library) is decoupled, Fluent itself ties into Vapor's lifecycle and dependency injection. Using Fluent outside Vapor is not recommended.
What databases does Fluent support?
Fluent supports multiple backends via driver plugins: PostgreSQL, MySQL, SQLite, MongoDB, and others. Verify the driver you need is actively maintained before committing.
How does Fluent handle N+1 query problems?
Fluent provides eager-loading and lazy-loading APIs. Use `.with()` to eagerly load relations and avoid N+1 queries. Testing and monitoring query counts in development are essential.

Software development & web development with DEV.co

From first prototype to production, DEV.co delivers software development services around tools like fluent. Our software development agency staffs experienced software developers and web developers for custom software development, web development, integrations, and ongoing support across open-source databases and beyond.

Ready to build with Fluent?

Fluent is ideal for Swift teams building Vapor applications with complex data models. Evaluate driver support for your database and test migrations before production. Need help assessing fit? Connect with our engineering team.