Skip to content

Commit

Permalink
(DOCSP-34585): Clarify details about the different ways of connecting…
Browse files Browse the repository at this point in the history
… with Edge Server (#642)

* Move wire protocol connection details to 'Connect' page

* Add details about the different ways you can connect

* Apply suggestion from review

Co-authored-by: cbullinger <[email protected]>

---------

Co-authored-by: cbullinger <[email protected]>
  • Loading branch information
dacharyc and cbullinger authored Dec 4, 2023
1 parent 86729c1 commit a0d4e79
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 33 deletions.
71 changes: 66 additions & 5 deletions source/edge-server/connect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
Connect to an Edge Server
=========================

.. facet::
:name: genre
:values: tutorial

.. contents:: On this page
:local:
:backlinks: none
Expand All @@ -14,15 +18,26 @@ Once the Edge Server is :ref:`configured <edge-server-configure>` and
:ref:`running <start-and-stop-edge-server>`, you can connect to it from
a client application.

There are two ways you can connect to the Edge Server from a client:

- Using the Device SDKs
- Using MongoDB Drivers and tools

When you connect to Edge Server using a Device SDK, Device Sync automatically
synchronizes data across devices and with the Edge Server. If you connect
to Edge Server using MongoDB Drivers or tools, you can perform CRUD operations
with a subset of supported MongoDB APIs.

.. _edge-server-connect-from-client:

Connect to the Edge Server from a Client
----------------------------------------
Connect to the Edge Server from the Device SDK
----------------------------------------------

To connect to the Edge Server from a client, your app must:
To connect to the Edge Server from a Device SDK client, your app must:

- Set the Sync URL to the public-accessible DNS address you set in the
Edge Server :ref:`config's <edge-server-install-and-configure>` ``hostname``
- Set the Sync URL on the App configuration to the public-accessible DNS
address you set in the Edge Server
:ref:`config's <edge-server-install-and-configure>` ``hostname``
field.
- If TLS is not enabled, use HTTP over port 80.

Expand All @@ -33,6 +48,18 @@ To connect to the Edge Server from a client, your app must:
you can coordinate with your Product or Account Representative to configure
HTTPS with a self-signed certificate.

For information about customizing the App configuration, refer to the
documentation for your preferred SDK:

- C++ SDK: :ref:`cpp-connect-to-backend`
- Flutter SDK: :ref:`flutter-connect-to-backend`
- Java SDK: :ref:`java-init-appclient`
- Kotlin SDK: :ref:`kotlin-connect-to-backend`
- .NET SDK: :ref:`dotnet-init-appclient`
- Node.js SDK: :ref:`node-connect-to-mongodb-realm-backend-app`
- React Native SDK: :ref:`react-native-connect-to-mongodb-realm-backend-app`
- Swift SDK: :ref:`ios-init-appclient`

Example: SwiftUI Template App
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -161,3 +188,37 @@ modifications you can make to the :github:`Swift template app
In a console app, delete the ``mongodb-realm`` directory. If you're
using an iOS or Android simulator or device, uninstall and reinstall
the app.

.. _edge-server-wireprotocol-connect:

Connect to the Edge Server with a MongoDB URI
---------------------------------------------

You can connect to the Edge Server using standard MongoDB Drivers and tools.
Clients use a specialized MongoDB URI connection string to connect to
Edge Server and send requests.

The wire protocol server is on by default. You can connect to it via the
host machine using this MongoDB URI:

.. code:: console

mongodb://EDGE_SERVER_HOSTNAME:27021

The ``EDGE_SERVER_HOSTNAME`` is the public DNS of your Edge Server host.
For more information, refer to :ref:`edge-server-install-and-configure`.

You must make port 27021 accessible to the client through port mapping or
firewall rules.

.. example::

A wire protocol connection URI for an Edge Server hosted on Amazon EC2
might look similar to:

.. code:: console

mongodb://ec2-13-58-70-88.us-east-2.compute.amazonaws.com:27021

Edge Server currently supports a subset of the MongoDB APIs. For information
about the supported APIs, refer to :ref:`edge-server-mongodb`.
34 changes: 6 additions & 28 deletions source/edge-server/mongodb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
Edge Server MongoDB API Support
===============================

.. facet::
:name: genre
:values: reference

.. contents:: On this page
:local:
:backlinks: none
Expand All @@ -15,38 +19,12 @@ which allows you to access your Atlas data on the Edge using standard
MongoDB drivers and tools.

Clients use a specialized MongoDB URI connection string to connect and
send requests.
send requests. For more information about how to connect to the Edge Server
using a MongoDB connection string, refer to :ref:`edge-server-wireprotocol-connect`.

Edge Server currently supports a subset of the MongoDB APIs over the
wire protocol.

.. _edge-server-wireprotocol-connect:

Connect to the Edge Server
--------------------------

The wire protocol server is on by default. You can connect to it via the
host machine using this MongoDB URI:

.. code:: console

mongodb://EDGE_SERVER_HOSTNAME:27021

The ``EDGE_SERVER_HOSTNAME`` is the public DNS of your Edge Server host.
For more information, refer to :ref:`edge-server-install-and-configure`.

You must make port 27021 accessible to the client through port mapping or
firewall rules.

.. example::

A wire protocol connection URI for an Edge Server hosted on Amazon EC2
might look similar to:

.. code:: console

mongodb://ec2-13-58-70-88.us-east-2.compute.amazonaws.com:27021

CRUD APIs
---------

Expand Down

0 comments on commit a0d4e79

Please sign in to comment.