by Vivien | Jun 12, 2025 | Data Sync, Mobile Database, ObjectBox
ObjectBox Data Sync Setup Steps for Java (5 Minute tutorial)
Note: ObjectBox Data Sync always includes MongoDB Connector
1Register for Trial
2Pull Docker Image
docker pull objectboxio/sync-server-trial
3Update Build Configuration
Go to your gradle build file and make this change:
// Change from: apply plugin: 'io.objectbox' // To: apply plugin: 'io.objectbox.sync'
4Add @Sync to Entities
Add the import and annotation to each entity you want to sync:
import io.objectbox.annotation.Sync; // Add this import @Sync // Add this annotation @Entity public class YourEntity { // Your entity fields (no relationships to non-synced entities) }
5Generate Data Model
- Build project → find gradle-support/objectbox-models/default.json
- Copy to project root as objectbox-model.json
6Start Sync Server
Windows:
docker run --rm -it --volume "%cd%:/data" --publish 127.0.0.1:9999:9999 --publish 127.0.0.1:9980:9980 objectboxio/sync-server-trial --model /data/objectbox-model.json --unsecured-no-authentication --admin-bind 0.0.0.0:9980
Linux/Mac:
docker run --rm -it --volume "$(pwd):/data" --publish 127.0.0.1:9999:9999 --publish 127.0.0.1:9980:9980 objectboxio/sync-server-trial --model /data/objectbox-model.json --unsecured-no-authentication --admin-bind 0.0.0.0:9980
7Add Sync Client to App
Add these imports to your main application class:
import io.objectbox.sync.Sync; import io.objectbox.sync.SyncClient; import io.objectbox.sync.SyncCredentials;
Add this code after creating your ObjectBox store:
if (Sync.isAvailable()) { SyncClient syncClient = Sync.client(store, "ws://127.0.0.1:9999", SyncCredentials.none()).build(); syncClient.start(); logger.info("Sync client started"); }
Note: - Important: Never close ObjectBox store while sync is active (generally, there is rarely ever need to close the store, so if you feel you need to, be very careful with this)
- Only sync entities that don't have relationships to non-synced entities
- Vector embeddings are not yet syncable (reach out to us if you need this!)
- Keep the store open throughout application lifecycle
- To test, run app with different database paths and add data in one instance, verify it syncs to the other
by Vivien | Jun 2, 2025 | Data Sync, Mobile Database, ObjectBox, Release
We’re excited to announce the latest updates to ObjectBox Sync Server with our recent 2025-06-02 and 2025-05-27 releases. These updates bring significant improvements to data handling, authentication, and user interface, making your data synchronization experience even smoother.
Powering Up Your Data Flow
Exciting news for developers! Starting from late May 2025, ObjectBox Sync Server trials are publicly available as Docker images on Docker Hub. This means you can now effortlessly pull our Sync Server trial directly with a simple command:
| docker pull objectboxio/sync-server-trial |
This provides a straightforward, no-fuss way to start testing the Sync Server with your data. Each trial gives you 30 days per dataset to explore the full spectrum of ObjectBox Sync capabilities, allowing you to experience its power and ease of use firsthand.
New “JSON to Native” External Property Type
Managing complex, nested JSON structures and mapping them to native database objects can be cumbersome and lead to data integrity issues. One of the most powerful additions in the 2025-05-27 release is the new “JSON to native” property type mapping. This feature allows you to convert strings to nested documents in MongoDB, providing a more elegant way to handle complex data structures. Note: This feature requires client version 4.3 or newer to function correctly.
Here’s how you can implement it in your applications:
| // Java @ExternalType(ExternalPropertyType.JSON_TO_NATIVE) private String myNestedDocumentJson; |
| // Kotlin @ExternalType(ExternalPropertyType.JSON_TO_NATIVE) var name: String? = myNestedDocumentJson |
| // Dart @ExternalType(type: ExternalPropertyType.jsonToNative) String? myNestedDocumentJson; |
| // Swift // objectbox: externalType="jsonToNative" var myNestedDocumentJson: String? |
Key Advantages of “JSON to Native”
- You can use your preferred JSON API to access the data
- It supports nested documents and arrays
- The order of keys is preserved, unlike with flex properties
Increased Maximum Sync Message Size
We’ve increased the maximum Sync message size to 32 MB, allowing for larger data transfers between clients and the server. This improvement is particularly useful for applications that need to synchronize larger chunks of data or complex documents. Clients version 4.3.0 and above are required.
Enhanced JWT Authentication
JWT authentication has been improved with more flexible options for public key configurations. Public key URLs can now refer directly to PEM public key or X509 certificate files, in addition to the previously supported JSON formats.
This means you can now use the following formats for your public key URL:
- Key-value JSON file
- JWKS (JSON Web Key Set)
- PEM public keyfile
- PEM certificate file
This enhancement provides more flexibility when integrating ObjectBox Sync Server with various authentication providers and existing security infrastructures..
Admin UI Improvements
The 2025-06-02 release includes several user experience improvements to the Admin UI:
- Resolved issues on the GraphQL page for more reliable interactions
- Enhanced menu UI with improved icons and optimized padding for better visual clarity and navigation
Getting Started with the ObjectBox Sync Server Trial (including the MongoDB Connector)
If you haven’t tried ObjectBox Sync Server yet, now is a great time to start! With our publicly available Docker images, you can quickly set up and start testing (just ensure Docker is installed on your system):
| docker run --rm -it \ --volume "$(pwd):/data" \ --publish 127.0.0.1:9999:9999 \ --publish 127.0.0.1:9980:9980 \ --user $UID \ objectboxio/sync-server-trial \ --model /data/objectbox-model.json \ --unsecured-no-authentication \ --admin-bind 0.0.0.0:9980 |
- Note: this assumes you already have an existing data model (objectbox-model.json) ready. If you don’t, you can use the existing ObjectBox Sync Examples repository for a quick start.
- Then, access the Admin UI by opening your web browser and navigate to
http://127.0.0.1:9980
- Follow the on-screen instructions in the Admin UI to activate your 30-day trial per dataset.
Or just go here to register and follow the step by step guide to get syncing now.
If you are using Java, you can also follow this 7 easy steps to sstart syncing your data in minutes.
What’s Next?
We’re continuously working to improve ObjectBox Sync to make your data synchronization experience seamless and robust. Stay tuned for more updates and improvements in the coming months!
For detailed information about these features, please refer to our documentation:
by Anastasia | Feb 5, 2025 | Data Sync, Edge Database, Mobile Database, ObjectBox, Open Source, SQlite
Ever waited to order or pay with a waiter holding their ordering device in the air for a signal? These moments show why offline-first Data Sync is essential. With more and more services relying on the availability of on-device apps and the IoT market projected to hit $1.1 trillion by 2026, choosing the right solution – particularly online-only or offline-first data sync – is more crucial than ever. In this blog, we discuss their differences and highlight common Data Sync alternatives.
What is Data Sync?
Data synchronization (Sync) aligns data between two or more devices to maintain consistency over time. It is an essential component in applications ranging from IoT and mobile apps to cloud computing. Challenges in data synchronization include asynchrony, conflicts, and managing data across flaky networks.
Data Sync vs. Data Replication
Data Synchronization is often confused with Data Replication. Nevertheless, they serve different purposes:
- Data Replication: A unidirectional process (works in one direction only) that duplicates data across storage locations to ensure availability and prevent loss. It is simple but limited in its application, and efficiency, and lacks conflict management.
- Data Synchronization: A bidirectional process that harmonizes all or a subset of data between two or more devices. It ensures consistency across devices and entails conflict resolution. It is inherently more complex but also more flexible.
Online vs Offline Solutions: Why Offline Sync Matters
Online-only synchronization solutions rely entirely on cloud infrastructure, requiring a stable internet connection to function. While these tools offer simplicity and scalability, their dependency on constant cloud connectivity brings limitations: Online Data Sync solutions cannot guarantee response rates and their speed varies depending on the network. They do not work when offline or in on-premise settings. Using an Online Sync solution often entails sharing the data and might not comply with data privacy requirements. So, do read the terms and conditions.
Offline-first solutions (offline Sync) focus on local data storage and processing, ensuring the app remains fully functional even without an internet connection. When a network is available, the app synchronizes seamlessly with a server, the cloud, or other devices as needed. These solutions are ideal for on-premise scenarios with unreliable or no internet access, mission-critical applications that must always operate, real-time and high-performance use cases, as well as situations requiring high data privacy and data security compliance.
A less discussed, but in our view also relevant point, is sustainability. While there might be exceptions depending on the use case, for most applications offline-first solutions are more resourceful and therefore more sustainable. If CO2 footprint or battery usage is of concern to you, you might want to look into offline-first Data Sync alternatives.
Now, let’s have a look at current options:
Data Sync Alternatives
(If you are on mobile, click here for a view that’s optimized for mobile)