DEV.co
Open-Source Databases · realm

realm-dotnet

Realm .NET is a mobile-first, embedded database for C# applications that runs directly on phones, tablets, and desktops. It replaces SQLite and traditional ORMs with an object-oriented API and optional cloud sync. Critical warning: MongoDB deprecated Atlas Device Sync in September 2024; version 20+ is sync-free.

Source: GitHub — github.com/realm/realm-dotnet
1.3k
GitHub stars
177
Forks
C#
Primary language
Apache-2.0
License (OSI-approved)

Key facts

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

FieldValue
Repositoryrealm/realm-dotnet
Ownerrealm
Primary languageC#
LicenseApache-2.0 — OSI-approved
Stars1.3k
Forks177
Open issues161
Latest release20.1.0 (2025-01-07)
Last updated2026-01-21
Sourcehttps://github.com/realm/realm-dotnet

What realm-dotnet is

Apache-licensed C# binding to Realm Core supporting iOS, Android, UWP, macOS, Linux, and Windows. Offers direct object mapping, LINQ-style querying, relationships, and generics. Synchronous and asynchronous APIs. Natively compiled; no SQL layer. Deprecation of sync features effective September 2024 impacts long-term strategy.

Quickstart

Get the realm-dotnet source

Clone the repository and explore it locally.

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

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

Best use cases

Mobile & Desktop MVVM Apps

MAUI, WPF, Avalonia, Xamarin applications requiring local data persistence with strong C# binding and data-binding support. Ideal for offline-first UX where syncing was never planned.

Rapid Prototyping & MVPs

Quick-to-market applications leveraging simple object APIs and minimal boilerplate. Low ORM friction for early-stage projects with clear platform targeting (Windows/macOS/iOS/Android).

Embedded Analytics & Logging

On-device aggregation, local analytics, or structured event logging in .NET applications where real-time sync to cloud is not required or is handled independently.

Implementation considerations

  • Install via NuGet (stable releases) or private feed (nightly builds). API is minimal; most teams pick it up in hours. See Quick Start guide and examples (QuickJournal, SimpleToDo).
  • Plan for version 20+ if sync is not needed; audit existing sync-based code and storage compatibility before upgrade. Realm file format changes may require migration.
  • Schema design relies on C# class attributes. Use Fody weaving and SourceGenerator for bytecode instrumentation. Test on all target platforms (iOS, Android, Windows, macOS) early.
  • Thread-safety requires realm instances per thread; async APIs support proper Task-based concurrency. Benchmark against SQLite+EF for your specific query patterns.
  • Nightly preview builds available for early feature testing; consider staging environment validation before rolling to production.

When to avoid it — and what to weigh

  • Cloud Sync as Primary Feature — Device Sync is deprecated as of Sept 2024. Do not adopt Realm .NET if real-time bidirectional sync to MongoDB or custom backends is a core requirement. Migration path is unclear.
  • Cross-Platform Web or Server-Only Workloads — Realm is mobile/desktop-first. For server-side .NET (ASP.NET, cloud services), Entity Framework or Dapper are more appropriate and have clearer enterprise support.
  • Complex SQL Reporting or Data Warehousing — Realm lacks SQL query interface and is optimized for object-centric access patterns. Exporting to SQL for BI is manual. Not suitable for analytics-heavy workloads.
  • Multi-Vendor Lock-In Avoidance — Realm files are proprietary binary format; no open-source alternative access or conversion tools. Migration away requires export/ETL. Use SQLite if portability is non-negotiable.

License & commercial use

Apache License 2.0 (Apache-2.0). Permissive OSI-approved license allowing commercial use, modification, and distribution under the same terms.

Commercial use is permitted under Apache 2.0. However, the deprecation of Atlas Device Sync effective September 2024 signals MongoDB's shift in strategy; enterprises relying on sync should clarify long-term support commitments with MongoDB directly before committing to new projects.

DEV.co evaluation signals

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

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

Realm files are local embedded databases; encryption-at-rest and access control depend on OS-level file permissions and optional Realm encryption APIs (not detailed in provided data). No security audit or CVE history provided. Assume standard embedded database threat model (local file tampering, memory inspection). Code dependencies (Fody, SourceGenerator) should be reviewed for supply-chain risks. Deprecation of sync removes cloud-side security responsibilities but shifts risk to custom sync layer if implemented.

Alternatives to consider

SQLite + EF Core

Cross-platform, SQL-capable, mature ecosystem. Better for server-side .NET and complex queries. No sync deprecation. Trade-off: more boilerplate, slower object mapping.

Firebase/Cloud Firestore

Built-in real-time sync, cloud backend, cross-platform SDKs. Google-backed. Trade-off: vendor lock-in, cloud-first pricing, less fine-grained offline control.

LiteDB

Pure .NET embedded document database, no native dependencies, simpler deployment. Trade-off: smaller ecosystem, fewer mobile platform targets, less mature sync story.

Software development agency

Build on realm-dotnet with DEV.co software developers

Realm offers rapid setup for mobile-first .NET apps. However, audit the September 2024 sync deprecation and your data persistence strategy. Request a technical assessment to validate fit against SQLite, Firebase, or EF Core alternatives.

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.

realm-dotnet FAQ

Is Device Sync still supported?
No. MongoDB deprecated Atlas Device Sync in September 2024. Version 20+ ships without sync features. The community branch or version 19 may be used if sync is required, but future support is unclear.
Can I use Realm for server-side .NET (ASP.NET)?
Not recommended. Realm is mobile/desktop-first. Entity Framework or Dapper are standard server-side ORMs with better production tooling and scalability.
How do I migrate from SQLite to Realm?
Manual export/import. Read SQLite data, map to Realm object model, write to Realm. No built-in migration tool. Custom ETL script required.
Is the Apache 2.0 license commercially permissive?
Yes, Apache 2.0 is permissive and allows commercial use. However, review MongoDB's long-term roadmap for .NET SDKs given sync deprecation before committing new projects.

Work with a software development agency

DEV.co helps companies turn open-source tools like realm-dotnet into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your open-source databases stack.

Evaluate Realm .NET for Your Project

Realm offers rapid setup for mobile-first .NET apps. However, audit the September 2024 sync deprecation and your data persistence strategy. Request a technical assessment to validate fit against SQLite, Firebase, or EF Core alternatives.