forked from mongodb/docs-realm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintroduction.txt
141 lines (116 loc) · 6.05 KB
/
introduction.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
.. _intro-realm-database:
=====================
Introduction to Realm
=====================
.. contents:: On this page
:local:
:backlinks: none
:depth: 2
:class: singlecol
This introduction explains Realm for mobile application developers.
After reading, you should understand:
- What Realm Database is and what problems it solves.
- Reasons to use Atlas Device Sync to synchronize application data with MongoDB.
- Ways to use the Realm SDKs with Atlas App Services to work with your application
data.
What Problem Does Realm Solve?
------------------------------
Mobile developers face a number of unique challenges. You must:
- Handle the unpredictable environment of mobile apps. Connections can be lost,
devices can shut down at any time, and clients often update long after release.
- Maintain common data schemas and APIs between mobile clients, backend APIs, and databases.
- Stay aware of security vulnerabilities across all components in an ecosystem.
- Consistently serialize objects between networks, database storage, and application memory.
- Program in the languages and frameworks for one or more mobile operating systems.
All of these challenges present different obstacles. You can solve each in isolation
with a wide variety of libraries and frameworks. Deciding the right solution for each
problem with the right tradeoffs is a challenge mobile developers know all too well.
The combination of multiple environments creates even more challenges.
For instance, you can use a Java library on your Android client to serialize objects,
but that library likely wouldn't work on iOS. And this doesn't even take into account
consistency across backend services.
Realm Database
--------------
Many of these challenges arise due to particularities of the mobile environment.
These challenges include network reliability, local storage, and keeping UIs
:wikipedia:`reactive <Reactive_user_interface>`.
Realm Database solves many common mobile programming headaches:
- **Local storage**: Realm Database runs right on client devices. Access objects
using the native query language for each platform. Storing, accessing, and updating
your data is simple and lightweight.
- **Network reliability**: Realm Database is offline-first. You
always read from and write to the local database, not over the network.
When Device Sync is enabled, Realm Database synchronizes
data with App Services over the network in a background thread.
The sync protocol resolves conflicts
consistently on each client and in the
linked Atlas cluster.
- **Reactive UI**: Live objects always reflect
the latest data stored in Realm Database. You can
subscribe to changes, letting you keep your UI consistently up to date.
The Realm SDKs connect to local realms for Android, iOS,
Node.js, React Native, Flutter, and UWP development.
Sync Data with MongoDB Atlas
----------------------------
Client applications generate a lot of data. Whether it's uploaded
reviews and ratings, posts and comments on a blog, or inventory
in a kitchen, you need to store that data somewhere.
The Realm SDKs use Atlas Device Sync to synchronize app data between clients and
MongoDB Atlas. Atlas Device Sync handles network access and conflict resolution
in a background thread of your application, so your application logic stays
the same regardless of network conditions.
Once your client data is in Atlas, you can leverage the full
Atlas developer data platform.
Perform aggregations and other complex workloads with the full capabilities
of MongoDB. Or connect your Atlas instance to `Charts
<https://www.mongodb.com/products/charts?tck=docs_realm>`_ to visualize
your data in real time. Storing your data in Atlas makes it
easy to share data across users and platforms.
Use Atlas App Services
----------------------
The Realm SDKs integrate with App Services to easily and securely work
with data from your app:
- Query MongoDB Atlas directly from the Realm SDKs using built-in
MongoDB interfaces. You can also configure the :ref:`Atlas Data API <data-api>`
to query MongoDB using an HTTP client in your app.
- :ref:`App Services Users and Authentication <users-and-authentication>`
provide built-in user management. Integrate with a
:ref:`JWT authentication service <custom-jwt-authentication>` or directly with
:ref:`third-party authentication providers <auth-providers>`,
like :ref:`Facebook <facebook-authentication>`, :ref:`Google <google-authentication>`,
and :ref:`Apple <apple-id-authentication>`.
- :ref:`Atlas Triggers <triggers>` automatically execute an Atlas Function
at a scheduled time or when an event occurs,
such as a change to a MongoDB database in Atlas or a user logs in.
- The :ref:`Atlas GraphQL API <graphql-api>` accesses data stored
in a linked MongoDB cluster with a standard GraphQL client.
- :ref:`App Services Rules <rules>` control who accesses what data.
- :ref:`App Services Values and Secrets <values-and-secrets>`
define global variables and private credentials once and
use them across your entire App.
Get Started with Realm
----------------------
Learn more about the Realm SDKs:
- :ref:`C++ SDK <cpp-intro>`
- :ref:`Flutter SDK <flutter-intro>`
- :ref:`Java SDK <java-intro>`
- :ref:`Kotlin SDK <kotlin-intro>`
- :ref:`.NET SDK <dotnet-intro>`
- :ref:`Node.js SDK <node-intro>`
- :ref:`React Native SDK <react-native-intro>`
- :ref:`Swift SDK <ios-intro>`
- :ref:`Web SDK <web-intro>`
Summary
-------
- Realm Database is an offline-first mobile object database in
which you can directly access and store live objects without an
:wikipedia:`ORM <Object-relational_mapping>`.
- Live Objects always reflect the latest state of data in the database,
which simplifies keeping your UI in sync with changes to your data.
- Atlas Device Sync synchronizes data between client-side realms and the
server-side MongoDB Atlas cluster linked to your app.
Realm Database synchronizes data in a background thread,
abstracting away network usage so you don't have to worry about
latency or dropped connections.
- The Realm SDKs integrate with App Services to easily and securely work
with your data in Atlas.