Couchbase lite android - What is synchronized and what is not? - couchbase

When we sync our local couchbase database in android with the server, what is exactly being synced? Do we have control over what can be synced and what not?
Right now I give the sync URl and Couchbase syncs the whole database (rather documents with appropriate channels to the android application). Is there any other way of controlling which data is synced?
Also are views created on the server synced to the mobile application as well? If not, is there a way to replicate the server view as well to the mobile app?

To answer your second question first, views are not replicated, as they're part of the app installed on the mobile device. This makes sense as the indexes you have for the set of data is really a function of how the app is going to use it. Also, views on Couchbase Mobile are typically implemented in the native language (Android, iOS, Xamarin C# or Unity).
Regarding sync, channels are the primary way to filter down what's going to be sync'd to a device. Since they can be added either declaratively or programmatically in a sync function, it's pretty flexible. What other way might you be seeking?

Related

Expose "all changes since" via wordpress JSON api

I'm struggling to find a solution to what I thought would be a common requirement so I'm hoping someone can help me with some pointers on what to search for/areas to explore.
Background
I'm building an iOS mobile app. I'm storing data locally using realm.io. The app is preinstalled with a snapshot of the content of a Wordpress mySQL database (it uses custom types). The content of the WP database is only written via the Wordpress install, the mobile app cannot write data.
Objective
So, I want to be able to check for changes since a given date (whenever the local database was last updated) and send the changed records to the mobile app (via the wp JSON api?).
I think I can fetch "posts since a date" but I need a full list of all create, update and delete operations since a given date.
Since the app is read-only I thought this type of one-way sync would be pretty straight forward but I can't find a common solution.
Any ideas to point me in the right direction would be great. Obviously, if anyone has any experience of doing this sort if thing with realm.io then that would be amazing :-)
Realm doesn't support yet any sort of synchronization mechanism across different files. We have an issue about that though, but you're likely searching rather for a solution in the immediate future.
Update: Realm launched the Realm Mobile Platform. This offers synchronization functionalities and would greatly simplify the solution for this use case.
You could use e.g. the server-side Node.js binding to pull new data from your MySQL Wordpress installation and push them to a global Realm served by the Realm Object Server. This can be read-only synchronized from the mobile apps, which would automatically receive the deltas and provide updated data to your users.
Whatever mechanism you come up yourself though in the meantime, it would require that you have read-write access from your iOS application to the realm database, so that you can update it with new data.
Pushing changed records as you describe is likely not going to work.
Apple's Push Notification service (APNS), which is the only back communication channel that works when your app is in the background or suspended, allows you to send very small payloads. You would use that to signalize your iOS app, that something changed on the server-side and there is new data to load. You would then initiate a request to a JSON-based API, wait for the response, map the returned JSON to Realm objects and store them in your database.
You want probably read more in the "Downloading Content in the Background" section of background execution chapter in the official App Programming Guides for iOS.
While pre-seeding the database from the app bundle seems like a nice idea, because the user wouldn't need to wait initially after downloading the app, that will enlarge the app itself with data, which might become in the future completely irrelevant.

Use PouchDB as embedded database within phonegap app

I'm just getting started with PouchDB. I would like to be able to use PouchDB within HTML5 apps for mobile devices created using Phonegap or Cordova. While going through the Getting Started guide on the PouchDB site, it looks like you are supposed to run through a server (or localhost) rather than through the file system. As I am trying to create an app which runs offline, wouldn't a Phonegap app, in essence, be using the file system on the mobile device and not a server/localhost?
I'm sure this is a basic question, so forgive me if this is too obvious, but I haven't found anything clear on this topic through my searches.
Thank you.
PouchDB is able to sync with a remote database running on a server, such as CouchDB, Cloudant, or Couchbase.
However, it's also perfectly OK to run it as a purely local database. When you do:
var db = new PouchDB('foobar');
...then you have a local database called "foobar," using either IndexedDB, WebSQL, LevelDB, SQLite, or whatever the browser/device supports. So ultimately it writes to the local filesystem.
Hope that helps!
Click here!
I reckon this may be a good example for you build a offline apps. In fact, you could use Angular + pouchDB + websql. I am working on some projects which related to that. Look forward to further questions.

data synchronization among multiple devices

There is my website this is an accounting software. now i am willing to create mobile application for my website in android windows and ios.
And i want to synchronize data properly across all devices.
currently i am doing testing with aws cognito. but I have some issues with this.
Is there any other thing which full fill my requirement.
main thing is that i dnt want to develop synchronization logic in my software i want to use any service which provide this facility.
you can go through this link and find what i want
http://aws.amazon.com/cognito/
Since your application is web-based, you must have a database attached to your application's web site.
Your mobile applications should not store large amounts of data if at all possible. Instead, your applications should retrieve and modify data in the website's database through RESTful web APIs.
This eliminates the need for data synchronization because all data is stored in a single repository.

How can I migrate my WP8 application to universal when it uses a local linq to sql db?

EDIT: To clarify, I am referring to the local database support: Local Database for Windows Phone 8 using Microsoft.Phone.Data.Linq namespace. I believe that the technology is based on SQL CE.
I have an existing Windows Phone 8 application that I would like to migrate to the new Universal Windows application framework. The application relies heavily on Linq to SQL that is baked into the Windows Phone Silverlight API. I understand that I can stick with Silverlight, but it seems to me that it is only a matter of time before Microsoft pushes us all to Universal. Additionally, it just makes sense if I want to present this application as a Windows application too.
So, I'm really struggling with how I could make this transition and not screw my existing users over. Clearly I could just rearchitect the application with a different data layer and let the users re-create their configuration, but that isn't a desireable way to treat my users.
I'm happy to migrate to a different persistence mechanism, but still the problem remains of how to get their existing configuration to migrate the data? The only option that I've come up with is to create an intermediate version using Silverlight that migrates the data to a new format, and then to later upgrade the application to universal. In this scenario it is still possible to lose users along the way if they miss the intermediate upgrade.
Ideas?
An intermediate release of your Silverlight app that performs the migration is the best way to go. If you have that version in the store for a while, you should get most of your users transitioned over, especially once they upgrade to Windows Phone 8.1, which auto-updates apps by default.
Amm... I'm not shure, but SQL for Windows 8.1 is already available and SQL for Windows Phone 8.1 is in preview status. It's not a LinqToSQL, but it works. So, I think, You can try to use it to interact with current data-files on your users clients, until they are SQL-database too.
Try this: http://blog.tpcware.com/2014/04/universal-app-with-sqlite-part-1/

Interface between CardDav server and MySQL database

My web app uses mysql to store contact data. I'd like to sync this data via carddav with mobile devices. I understand carddav is based on a file system, not a database. What software is available to act as an interface or wrapper to make the carddav server work with mysql? or other relational database?
You might want to take a look at Bedework.
Baikal just added this feature!!!
Most dav servers are file system based. If you use SabreDav you can build a virtual filesystem based on your own backend. Baikal is a project that uses sabredav, and a virtual file system. Until recently it stored its data in sqllite. Now it supports both mysql and sqlite.
Its still not 100% mature, but its a great starting point. Playing around with it, I have been able to create contacts directly in the DB (by uploading vcard blobs to a table) and then having them show on my ipad addressbook.
After evaluating many systems, ones built on sabredav like baikal tend to be the simplest to build on. Fruxx is something else you may also check out. Its a hosted system, but will soon have an api.
Last if you are looking for a very elaborate system, then take a look at tine20. It supports activesync (illegally in the usa), carddav, caldav, and has a decent extjs web ui. It natively stores contact information in its mysql store, which is nice since you can update a contact through a sql statement without having to build a vcf file. Where tine doesnt make sense is that it uses a bit more resources because of all the features it offers, and the complexity has ensured that it has a VERY complicated database schema. In other words, you are probably better off creating a rest api on the tine source code rather than doing bare sql inserts.
http://baikal-server.com/