realm-swift
Realm Swift is an embedded mobile database for iOS, macOS, tvOS, and watchOS that replaces Core Data and SQLite. It provides an object-oriented data model with live objects, encryption, offline support, and native SwiftUI integration, designed to reduce boilerplate code and simplify local data persistence on Apple platforms.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | realm/realm-swift |
| Owner | realm |
| Primary language | Objective-C |
| License | Apache-2.0 — OSI-approved |
| Stars | 16.6k |
| Forks | 2.2k |
| Open issues | 498 |
| Latest release | v20.0.5 (2026-06-14) |
| Last updated | 2026-06-14 |
| Source | https://github.com/realm/realm-swift |
What realm-swift is
Realm Swift is a cross-platform mobile DBMS written in Objective-C with Swift bindings, featuring reactive live objects, in-flight and at-rest encryption, thread-safe transactions, and built-in SwiftUI property wrappers (@ObservedResults). It uses a custom binary format optimized for mobile memory and battery constraints, installable via SPM, CocoaPods, Carthage, or XCFramework.
Get the realm-swift source
Clone the repository and explore it locally.
git clone https://github.com/realm/realm-swift.gitcd realm-swift# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- Requires Xcode 15.3+; verify build toolchain compatibility before adoption.
- Encryption key management is the developer's responsibility; losing or mishandling the key renders encrypted databases inaccessible.
- Live objects hold strong references to the underlying realm instance; improper lifetime management can cause memory leaks or performance degradation.
- Query performance depends on proper schema design and indexing; monitor for N+1 queries in notifications.
- SwiftUI integration requires iOS 15+; legacy UIKit codebases need fallback patterns or custom bindings.
When to avoid it — and what to weigh
- Server-Side Persistence Required — Realm Swift is a client-side embedded database. Applications requiring centralized SQL database or traditional server-backed persistence should use a backend database service instead.
- Cross-Platform (Non-Apple) Requirement — This repository supports only Apple platforms (iOS, macOS, tvOS, watchOS). Android or web backends need separate SDKs; this does not provide a unified solution.
- Complex SQL Queries or Reporting — Realm uses its own query language and is optimized for object-oriented access patterns. Teams heavily invested in SQL syntax, complex JOINs, or BI-style reporting may find it limiting.
- High-Volume Concurrent Write Operations — Realm is designed for mobile single-user or light multi-user scenarios. Applications requiring high-throughput write concurrency or distributed transactions should use a traditional database.
License & commercial use
Apache License 2.0: permissive OSI-approved license permitting commercial use, modification, and distribution with attribution and liability disclaimer.
Apache 2.0 is a permissive license allowing unrestricted commercial use. Verify compliance with internal IP policies and include a copy of the license in distribution. No warranty or commercial support is implied by the license alone; MongoDB offers commercial support separately.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Strong |
| License clarity | Clear |
| Deployment complexity | Low |
| DEV.co fit | Good |
| Assessment confidence | High |
Realm supports field-level encryption (both in-flight and at-rest) using a 64-byte key managed by the developer. Security posture depends on: (1) secure key generation and storage (e.g., Keychain on iOS), (2) proper configuration application, (3) keeping dependencies current. Encryption implementation is not independently audited in the provided data. Threat model and compliance certifications unknown.
Alternatives to consider
Core Data
Apple's native iOS persistence framework. Offers deeper OS integration but has steeper learning curve, less intuitive API, and no built-in encryption. Suitable if strict Apple-only support and minimal external dependencies are required.
SQLite (via GRDB or sqlite3)
Lower-level relational database available on all Apple platforms. Provides more SQL flexibility and maturity but requires manual ORM, schema migrations, and thread management. Better for teams with existing SQL expertise.
CloudKit
Apple's cloud sync solution for iCloud-backed apps. No local query capability without CloudKit integration, but offers seamless Apple ecosystem sync. Use if app is exclusively Apple and iCloud sync is primary requirement.
Build on realm-swift with DEV.co software developers
Our mobile engineering team can assess your data persistence requirements, design a schema, and guide implementation. Get a custom recommendation.
Talk to DEV.coRelated 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.
realm-swift FAQ
Can I use Realm in production for iOS apps?
Is Realm data encrypted by default?
Can I sync Realm data to a backend server?
Does Realm work offline?
Software developers & web developers for hire
Adopting realm-swift is usually one piece of a larger software development effort. As a software development agency, DEV.co provides software development services and web development expertise — pairing senior software developers and web developers with your team to design, build, and operate open-source databases software in production.
Ready to evaluate Realm Swift for your iOS project?
Our mobile engineering team can assess your data persistence requirements, design a schema, and guide implementation. Get a custom recommendation.