CoSync Apps

What is a Cosync Application? #

Within the Cosync Portal, a developer maintains a number of applications that each contain a collection of users. The portal provides a developer with functionality to create, edit, and delete applications. It also provides a developer with the capability to manage users within each application, if the developer is using the CoSync Auth authentication service.

Cosync Portal #

An application within the Cosync Portal maps onto a MongoDB App Services Application that is being implemented by the developer, which may or many not use the CoSync Auth authentication service. The mapping between a Cosync application and a MongoDB Realm Application is isomorphic. In the older Realm Cloud product, an application was called a Realm instance.

Nevertheless, it’s worth mentioning that an application in the Cosync Portal doesn’t have to be specifically tailored for a MongoDB App Service Application. It can serve as a JWT authentication provider for any mobile or web application. Put simply, Cosync was initially designed to seamlessly integrate with MongoDB App Service Applications, but it’s not mandatory. In other words, developers have the flexibility to utilize Cosync as a JWT authentication provider for any type of mobile or web app, regardless of its connection to MongoDB App Service.

Cosync Auth in Application #

To incorporate the Cosync Auth or Cosync AssetLink into a MongoDB App Services application, the developer needs to initially set up an application within the Cosync Portal. While it is possible to enable the optional CoSync Auth authentication service for the application, it is not obligatory. The Cosync AssetLink is compatible with any authentication provider supported by MongoDB App Services. In particular, developers may choose to leverage Cosync’s AssetLink functionality without incorporating the Cosync Auth JWT authentication aspect.

Connect to a Realm App #

Typically, a MongoDB Realm Application is associated with a MongoDB Atlas Cluster that serves as the underlying database for the application. The cluster contains a database consisting of collections, which in turn contain objects adhering to the application’s schema. Within the MongoDB portal’s App Services tab, a MongoDB Realm Application establishes a connection between Realm objects and the MongoDB Atlas Cluster database through a mechanism known as Device Sync.

There are two types of Device Sync methods available: Flexible Sync and Partition Based. It is recommended to use Flexible Sync as the preferred approach when working with MongoDB Realm. The Partition Based strategy is a carryover from the legacy Realm and is anticipated to be phased out. For more details on Partition Based sync, refer to MongoDB Realm Partitioning. The Cosync AssetLink product is specifically designed around Flexible Sync.

Application Type #

The Cosync Portal offers support for two application types: sandbox and hosted. A sandbox application is limited to a maximum of fifty users, while a hobbyist account allows for up to 20 development applications, with each application limited to 50 users. To create hosted applications, developers need to register as paid Developers within the Cosync Portal. The base subscription, priced at $29.95 per month, includes support for up to three hosts. Sandbox applications serve as test environments for developers to gain familiarity with the CoSync Auth authentication technology.

Hosted applications operate on servers provided by the developers, typically utilizing an Azure App Service, and store user data in a MongoDB Atlas cluster also managed by the developers. Cosync does not store user data or provide compute resources for running the authentication server. These responsibilities lie solely with the developers. Scaling issues and bandwidth optimization are handled exclusively by MongoDB for the database and by the internet service provider (such as Microsoft Azure), respectively. The role of CoSync Auth is to serve as the connecting software, enabling secure authentication, and providing an admin portal for application management.

In contrast to other authentication providers, Cosync does not charge developers based on the number of users. Instead, it offers a fixed hosting fee of $228 per year for up to three hosts. Each host can accommodate an unlimited number of applications and users. If a developer fails to pay the developer license, either because the credit card has expired, or has requested reimbursement for those charges, the developers hosts will no longer be reachable through the Cosync Portal, they will however continue to function

Application Status #

The Cosync application status determines whether an application is operational or not. There are three possible application status values:

  • active,
  • inactive,
  • migrated.

If the application status is active, it is up and running and can allow users to be authenticated into it. At any time, a developer can choose to set the status of an application to inactive. When this is done, all REST API calls to the CoSync Auth service will no longer work - including login. The other status is migrated, which means that the application has been migrated to another host.

Application Attributes #

An application within the Cosync Portal has the following attributes:

  • Application Name,
  • Application Id (assigned at creation),
  • Status (active, inactive, or migrated),
  • Users.

The Application Name is a descriptive name for the application; it must be unique within the list of applications owned by the developer. It can also be changed at any time. The Application Id is a unique global identifier (GUID) that is assigned to the application at creation.