cloudant database local cache with java api - cloudant

i am new to the cloudant , i tried searching the internet but could not found the correct reference about the Cache.
can u please provide me some reference based on java .like api,or links which reference on caching.

I'm assuming by cache you mean replicating all or a subset of your Cloudant data to a local datastore. If so, have a look here: https://github.com/cloudant/sync-android
Applications use Cloudant Sync to store, index and query local JSON
data on a device and to synchronise data between many devices.
Synchronisation is under the control of the application, rather than
being controlled by the underlying system. Conflicts are also easy to
manage and resolve, either on the local device or in the remote
database.
...
This library is for Android and Java SE; an iOS version is also
available.
There are examples on the above page of using the library.
Where you see the word 'device' on the above page, you can also think 'java app'.

Related

A plea for a basic Notebook example getting data into and out of Google Cloud Datalab

I have started to try to use the Google Cloud datalab. While I understand it is a Beta product, I find the Doc's very frustrating, to say the least.
The questions here and lack of responses as well as lack of new revisions or docs over the several months the project has been available make me wonder if there is any commitment to the product?
A beginning would be a notebook that shows data ingestion from external sources to both the datastore system and the Big query system. That is a common use case. I'd like to use my own data, it would be great to have a Notebook to ingest it. It seems that should be doable without huge effort? And it would get me (and others) out of this mess trying to link the various terse docs from various products and workspaces up and working together..
in addition to a better explanation of the Git hub connection process (prior question))
For BigQuery, see here: https://github.com/GoogleCloudPlatform/datalab/blob/master/content/datalab/tutorials/BigQuery/Importing%20and%20Exporting%20Data.ipynb
For GCS, see here: https://github.com/GoogleCloudPlatform/datalab/blob/master/content/datalab/tutorials/Storage/Storage%20Commands.ipynb
Those are the only two storage options currently supported in Datalab (which should not be used in any event for large scale data transfers; these are for small scale transfers that can fit in memory in the Datalab VM).
For Git support, see https://github.com/GoogleCloudPlatform/datalab/blob/master/content/datalab/intro/Using%20Datalab%20-%20Managing%20Notebooks%20with%20Git.ipynb. Note that this has nothing to do with Github, however.
As for the low level of activity recently, that is because we have been heads down getting ready for GCP Next (which happens this coming week). Once that is over we should be able to migrate a number of new features over to Datalab and get a new public release out soon.
Datalab isn't running on your local machine. Just the presentation part is in your browser. So if you mean the browser client machine, that wouldn't be a good solution - you'd be moving data from the local machine to a VM which is running the Datalab Python code (and this VM has limited storage space), and then moving it again to the real destination. Instead, you should use the cloud console or (preferably) gcloud command line on your local machine for this.

React Native - connect to PostgreSQL database

I would like to connect with React Native to an external database, like PostgreSQL, MySQL or what ever. Is this possible?
But first let me tell you something about my plan:
I will develop my application for multiple installations (multiple devices - one installation on one device). All devices are connected with a local network which is provided by a Windows installation (server). On the server runs a database (PostgreSQL) and I would like to connect to this database with all my devices.
The server (or in fact its database) should store tasks and each device should access to these tasks (read and write) locally.
I had also some other ideas like simple SMB-XML file storage (but the problem with collisions) and an SQLite database on an SMB shared file - but the website of SQLite tells that this will not avoid problems with multiple accesses. Therefore I need another local solution. This brought me to provide a database which is accessible from the local network.
I would be very grateful if someone has a note how to solve this problem.
Thank you!
In order to access a database directly from react native you would need a pure JavaScript database driver. A quick google search produced a JavaScript drivers for PostgreSQL (https://github.com/brianc/node-postgres) but it is written for Node.js and I doubt it will work in JavaScript Core or Chrome. CouchDB works via a REST API and it's actually intended for direct access by multiple clients. There are multiple JavaScript clients available for that.
BUT why do you want your clients to connect to the DB directly? What you describe seems like a pretty standard application model. You'll just need a backend running on your server talking to the DB and providing an API. Good old web development. If you want to write JavaScript on the backend I suggest using Node.js
If you really can't or don't want to write a backend, there are several services that provide API for data storage and even some data processing. But of course they aren't local. Have a look at parse.com or firebase.com for example.

DB solution for hybrid-mobile-app

I am going to build hybrid-mobile-app with Ionic, Angular and Cordova and port it to Android and iOS. One of the main features of the app will be offline storage/capability to store and view app content offline.
Content that I want to save in local DB may be even over 50MB, so local storage is not an option.
So far I found sqlite and indexdb. But I wonder if any of you have previous experience with similar problem to solve and could suggest some other options? Or maybe which option (sqlite or indexdb) will be better solution for my app?
You should also know that localStorage isn't a viable option for permanent device storage if you're going to build for iOS. The OS will wipe out localStorage data when device memory is low. IndexDB may be volatile too because it's stored within the context of the webview.
I develop an Ionic app which has some data stored (not a large amount at the moment) in SQLite. I chose localForage with SQLite driver. It works well for what I need because it stores the data to a database file in the filesystem which is safe from OS deletion. What's nice is that the functions are similar to what you get with localStorage; the biggest difference being that the functions use promises.
This is the stack of components that I used in order to implement what I have now:
Bower components
angular-localForage
localforage
localForage-cordovaSQLiteDriver
You will also need the Cordova-sqlite-storage plugin.
You may also have a look at LokiJS and PouchDB (blog articles from "GoneHybrid", implementing those 2 libs).
I would personally go for LokiJS (http://lokijs.org/) and its JSON file, even if both have adapters for WebSQL, SQLite, IndexedDB.
I was part of a team that built a successful Cordova / Sencha Touch (the UI framework doesn't really matter here) / SQLite app for iOS and Android. We had over 100Mb of data to store in the database, had to encrypt it and transfer it from a server into the app.
SQLite performed well, we also used some custom functions that we wrote to move some of the data crunching we needed into the database engine and out of Javascript.
Another member of the team wrote a short blog article about some of our experiences with this stack.
Overall given my experience, I'd say SQLite is a sound choice, but I don't have experience with IndexDB.

Graph Databases: standalone with java api

I am looking into graph database systems, but most of them seem to be either embedded or accessible via html request. I am searching for a standalone server, accessible via a java api, that supports acid (and clustering), preferrably open source.
I like neo4j, but I don't want to embed my db or access it with (slow) html requests, it has to be accessible by multiple systems. If I got it all wrong and neo4j is a super choice, please provide a link or name to a suitable driver, if you know one. Thank you.
Check out InfiniteGraph. It is not open source, but there is a free version for up to 1 million nodes and edges.

Pre populate client database with PhoneGap (primary target Android)

There have been a few articles and questions about how to do this but they all seem to have a bias to iOS.
So first of all I am currently using PhoneGaps database functionality:
http://docs.phonegap.com/en/1.0.0/phonegap_storage_storage.md.html
I have a database I need for the app to run from as it contains a lot of information, probably about 1mb worth (can be exposed as .db/.sql). So I want to be able to make my PhoneGap app and build it for as many platforms as possible. However I want it so that as soon as the user has installed the app it automatically installs the database for them.
Some of the solutions seem to recommend creating the database on first boot, but this just seems a bit hack-ish and sidestepping the problem.
I am more than happy to switch over to use webSQL if Android, iOS and other providers support it, however as PhoneGap wraps any available native OS DB functionality it seemed more realistic that you can get an app to pre-populate an Android database and access it via PhoneGap than pre-populate a web database and access it via webSql.
Hopefully this question makes sense and there have been advances since mid last year, which seems to be the last up to date post on this sort of thing.
I just answered another similar question on this topic. First PhoneGap doesn't implement the Storage function that is documented. In fact we take advantage of the sqlite and localStorage functionality that is implemented in all webkit based browsers.
My recommendation is for you to pre-populate a SQLite DB and on application startup copy the DB to the correct location so your app can access it. There is a good blog post on this topic at:
http://gauravstomar.blogspot.com/2011/08/prepopulate-sqlite-in-phonegap.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+GauravSTomarBootstrappingIntelligence+%28Gaurav+S+Tomar+%3A+Bootstrapping+Intelligence%29

Resources