The all-new DataSync is here.
With the addition of DataSync to our synchronization offerings, we now provide the best and the most comprehensive synchronization solutions in the headless CMS space. We have something for every kind of content synchronization need. And that makes us the go-to choice for all things synchronization related.
Our Synchronization offerings include the following components:
- Sync API Get all content or only incremental (delta) updates, anywhere, anytime.
- DataSync (New) Sync Contentstack data with your database (FileSystem, MongoDB)
- SDKs with Sync API support Build power apps using our SDKs which now support Sync APIs
- Mobile sync helpers Create offline apps by storing content on the device’s local storage
We will learn more about each of these components later in this post.
All About the New DataSync
Contentstack DataSync Overview
DataSync allows you to synchronize Contentstack data with your database (MongoDB, Filesystem, etc.).
DataSync consists of tools that we have combined to give you the best synchronization possible.
Whenever a piece of content is published, deleted or updated, Datasync saves a copy of the content changes in your database. Subsequently, all page requests are served directly from your database, instead of from Contenstack through APIs.
Why Use Contentstack DataSync?
Datasync is better than any synchronization module available. The following lists some of the compelling reasons to use DataSync.
- Deprecation of contentstack-express framework
The contentstack-express web framework has a built-in sync utility. However, we have deprecated the framework. If you are using the framework’s sync, please switch to the faster and better DataSync.
- Synchronize data fast
In comparison to the 'sync' functionality of the contentstack-express framework, DataSync synchronizes data over 8x faster! The former takes about 2 hours to synchronize 10,000 items, whereas the latter synchronizes the same data in under 10 minutes.
- Reduced API calls
Serving content through your database after syncing reduces the number of API calls made to Contentstack to fetch data.
- Use it with any database
We offer connectors for FileSystem and MongoDB databases. But you can write your own connectors and use DataSync with any database of your choice.
Learn more about DataSync.
Contentstack Synchronization Tools
The Sync API
In addition to DataSync Contentstack includes the Sync API that is part of our Content Delivery APIs and can be used to sync complete data and fetch incremental updates. It provides three main synchronization requests:
Initial sync: For synchronizing complete data, i.e., the content of a stack that has ever been published to the specified environment. Initial synchronization is usually used to load data when the user uses the app for the very first time.
Subsequent sync: For keeping your app up-to-date through delta updates. After completing an initial sync, this request fetches only the content that was published since the last synchronization.
Pagination token: To fetch the subsequent batches of data.
Read our Sync API documentation to get started with the Sync API.
DataSync allows you to synchronize Contentstack data with your database. While we have covered some basics in the previous sections, here are some additional resources to help you get started with DataSync:
- DataSync Overview
- Getting started with DataSync
- Create a Node.js app using Contentstack DataSync
- Contentstack DataSync vs contentstack-express
Most of our content delivery SDKs support Sync API. Refer to the corresponding documentation to learn how the Sync API works with these SDKs.
We have also created SDK-specific playground apps to help you get started with Contentstack Sync API. Clone these apps and try out the APIs to get a first-hand experience of the synchronization methods.
Mobile Sync Helpers
The mobile sync helpers enable your mobile apps to save data on the device’s local storage, which serve as the base for creating offline apps. These helpers contain methods that are required to map data fields of your content types and Realm database management system. Learn more about them.
We have created a couple of example applications that demonstrate using mobile sync helpers with our SDKs. Refer to the documentation to get started with the helpers.