What Problem does CoSync AssetLink solve? #
MongoDB Realm stands out as the premier offline-first real-time database for collaborative software development on a global scale. It represents the sole genuinely scalable solution for synchronizing client-side data seamlessly across an extensive array of platforms, encompassing iOS, OS/X, Android, Windows, and Web, all of which operate atop a unified server-less backend infrastructure.
In the realm of collaborative software development, data synchronization is often just one facet of the broader challenge. In most cases, applications involve not only data but also assets that necessitate sharing among users. These assets encompass large, unchanging files like images, music, videos, and documents. Presently, MongoDB Realm imposes a 4MB upper limit on supported object size. Consequently, it doesn’t offer a viable solution for managing assets, even when they are encoded in base 64. This limitation implies that assets might need to be fragmented into multiple 4MB objects, necessitating additional client application code for proper management. Furthermore, given MongoDB Realm’s lack of video and audio streaming capabilities, employing a strategy based on asset chunking would likely prove impractical.
Given these limitations, many application developers opt to incorporate an Asset Storage service, such as Amazon AWS S3, alongside MongoDB Realm to address their storage needs. However, this approach mandates the development of extra cross-platform code on the client side. Perhaps more significantly, it often necessitates the storage of sensitive credentials for the AssetLink Service directly within the client code, thereby introducing an additional security vulnerability.
At present, the MongoDB Realm development team has made an attempt to tackle this challenge through a deprecated third-party service known as AWS S3 Service Snippets. However, this solution demands that the application first uploads the asset data to the MongoDB Application server, which then forwards it to the Amazon S3 service. Unfortunately, the 4MB size limit on asset storage persists due to the constraints of base64 encoding! Moreover, the notion of having to upload an asset to a MongoDB Realm server before it reaches a AssetLink Service seems somewhat inefficient, as there is no inherent reason to prevent direct uploads from the client device to S3.
From the perspective of an application developer, an asset necessitates an HTTPS URL (universal resource locator) for effective integration within a client program. This is essential because image caching services (such as NSUrl or Kingfisher) often rely on URLs to function properly. Moreover, concerning image data, it is frequently important to manage different-sized versions of the image (small, medium, large, and original) to cater to various performance scenarios. Therefore, any asset management approach should encompass support for multiple image sizes.
In the case of video and audio assets, it’s vital that the AssetLink Service can stream the data within an application. This functionality can only be achieved through URLs connected to a AssetLink Service that provides CDN-like capabilities, as seen with Amazon S3.
Regarding MongoDB Realm, efficient asset management involves the use of data structures to monitor assets within the AssetLink Service. This should encompass the ability to generate write URLs for uploading asset data, as well as support for image asset resizing and video previews. The CoSync AssetLink service effectively bundles all of these functionalities into a convenient package, seamlessly integrating them with any MongoDB Realm application. Additionally, it offers enhanced security compared to many other solutions as Amazon S3 credentials are stored within MongoDB service functions rather than native client code.