Applications

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 CosyncJWT authentication service.

An application within the Cosync Portal maps onto a MongoDB Realm Application that is being implemented by the developer, which may or many not use the CosyncJWT 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.

In order to use the Cosync Engine within a MongoDB Realm application, the developer must first create an application within the Cosync Portal. Optionally, a developer may enable the CosyncJWT authentication service for the application, but this is not mandatory. The Cosync Engine works with any authentication provider supported by MongoDB Realm.

A MongoDB Realm Application is typically linked to a MongoDB Atlas Cluster that defines the data base for the application. A cluster contains a list of collections that contain objects that conform to cluster’s schema. A MongoDB Realm Application maps a particular Realm onto MongoDB Atlas Cluster through a concept called a partition key value. The partition key is a predetermined property key name, e.g. _partition, that contains a value. The partition key name is determined by the developer at the time MongoDB Realm Application is created. In order for an Atlas collection to be mapped into a Realm, it must contain a property with the same name as the partition key, e.g. _partition. It is the value of the partition key that defines which Realm the object in the Altas collection belongs to. The way to think about it is as follows, Altas maps objects into collections. Realms are a mapping upon the mapping and define objects within multiple collections as belonging to a specific Realm. In the old Realm Cloud product, individual Realms within a Realm Instance were more like collections within an Atlas database. However, in order to blend the two concepts together, the new MongoDB Realm created the concept of partitions. This concept is best explained here MongoDB Realm Partitioning

Application Type

The Cosync Portal supports two types of applications: development and commercial. A development type of application is limited to fifty users. A hobbyist account only supports three development applications. In order to create commercial applications, a developer must register as a paid Developer with the Cosync Portal. The base subscription, which is $6 per month, includes support for commercial applications with more than fifty users. A developer subscription includes up to five thousand - 5000 - users for commercial applications using the CosyncJWT service. Additional CosyncJWT service users are charged to the developer at a rate of $0.001 per user per month. If the developer is only using the Cosync Engine (without the CosyncJWT service), the number of users is unlimited. In other words, only the CosyncJWT service is metered, while the Cosync Engine is bundled as part of the Developer account.

Application Status

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

  • active
  • inactive
  • suspended
  • blocked

If the application status is active, it is up and running and can allow users to be authenticated into it. For a commercial application, subscription charges for CosyncJWT will only apply when the status is active. 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 CosyncJWT service will no longer work - including login. If a developer fails to pay his/her subscription and commercial app charges, either because the credit card has expired, or he/she has requested reimbursement for those charges, the application status will be set to suspended, which is functionally equivalent to inactive. Once a developer has submitted proper payment, a suspended application can be once again turned into active from the Cosync developer portal. If an application violates the terms of service for Cosync, the application may be blocked by the systems administrator. If this were to happen, the developer would need to contact Cosync to reinstate a blocked application to an active status.

An application within the Cosync Portal has the following attributes:

  • Application Name
  • Application Id (assigned at creation)
  • Type (development or commercial)
  • Status (active, inactive, suspended, or blocked)
  • 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. The Type determines whether the application is a free development application limited to 50 users, or a commercial application with metered users. The Type only has bearing with the CosyncJWT service, it does not affect the Cosync Engine.