0

Context

I'm developing a hybrid/mobile app using Cordova. This app displays content, such as news, magazine articles and weather info that is dynamically generated and delivered via a Web App (self-hosted developed with PHP). In order to decide which mobile devices "get" which content, I need to constantly keep track of the history of displays on each device, and gather information such as : article name, display date/time, location(lat/lon), etc.

The BIG problem I have is...

Now, because the data that I'm gathering is unstructured, I first tried with Firebase (Google), which allowed me to easily gather all the data, in real-time using a key:value schema and then retrieve my data on the webapp running another JS script. The problems with this solution are:

  1. Querying possibilities are too limited.
  2. I'm not comfortable leaving all my data handled by Google (Nothing against Google, butI'd prefer to own my data).

The Question

What are the storage strategies that I could use ? I've been reading a lot about Redis, Parse-server, PouchDB+CouchDB, and MongoDB, but I got lost in a world of information about NoSql databases, and now I really do not know what to do :'(

I've always used relational databases for my projects (Mysql, MariaDB), but I'm not afraid in getting my hands dirty with NoSQL databases, however I'd appreciate if anyone can point me to the easiest-to-implement solution.

EDIT (17/04/18)

I think I narrowed down my question to 2 options

  1. PouchDB + CouchDB, or
  2. Couchbase Mobile = Couchbase Lite + Sync Gateway

Can anyone, please give me some feedback with regards to these two options? Ease of implementation, Querying, maintenance, etc ?

Thanks!

HugoRMR
  • 142
  • 1
  • 3
  • In your research, did you consider the NoSQL options that Amazon is providing? – Megidd Apr 17 '18 at 10:50
  • If you need to work with geo-location features, like `lat` and `lon`, then you might want to take a look at [Cloudant Geospatial](https://console.bluemix.net/docs/services/Cloudant/api/cloudant-geo.html#cloudant-nosql-db-geospatial) options. – Megidd Apr 17 '18 at 10:55
  • Couchbase has the `N1QL` query language which is similar to SQL. Considering your SQL background, that might be a sensible option too. – Megidd Apr 17 '18 at 10:57
  • To clarify the Couchbase Mobile stack is = Couchbase Lite + Sync Gateway + Couchbase Server. – rajagp Apr 24 '18 at 13:28

1 Answers1

0

Figured, I should probably explain my earlier comment better. Couchbase Mobile = Couchbase Lite (runs on mobile device) + Sync Gateway + Couchbase Server (hosted in backend)

  • W.r.t your first concern

Querying possibilities are too limited.

Couchbase Server supports N1QL - which is a superset of SQL for NoSQL. So you should be able to do the kind of extensive querying that you want w/ Couchbase Server.This link discusses how you can do geospatial queries (since you mentioned that as a use case)

  • W.r.t your second concern

I'm not comfortable leaving all my data handled by Google (Nothing against Google, butI'd prefer to own my data).

With Couchbase Mobile, you have control over where the data is hosted - you have the option of persisting the data in Couchbase servers that you can host in private/public cloud (AWS, Azure, GCP).

  • Note on Cordova support in Couchbase Lite:

It is supported as a community project in Couchbase Lite 1.4. However, in the latest 2.0 release, you will have to develop your Cordova plugin on top of the native API .

rajagp
  • 1,443
  • 8
  • 10
  • Thanks @rajagp, I think will explore your solution further! Since my question I've migrated by code base to Nativescript, I'll look if couchbase can be implemented there as well. – HugoRMR Oct 21 '18 at 09:48
  • what did you pick and why? – Tinaira Mar 17 '20 at 05:28