Querying MongoDB Database from Corona

Does Corona have drivers to access MongoDB databases directly (without relaying via say a NodeJS server).

I am familiar with and love talking to CouchDB on cloudant.com all via REST HTTP requests but MongoDB has a non REST compatible binary object protocol (and needs a driver https://docs.mongodb.com/ecosystem/drivers/ )

I like the http://www.mongodb.com/atlas hosted clusters (via AWS).

Reading this now:  https://docs.mongodb.com/ecosystem/tools/http-interfaces/

Thanks in advance.

You would have to use Lua sockets and write  your own driver. We certainly don’t have one. Someone out there might have written one. Generally though direct access to your database is a security risk.

Rob

Thanks

I have a distributed set of servers to manage the workload and minimise risk and maximise the platforms strengths (I though).

CouchDB on cloudant was all HTTP based and assigning permissions and hitting via REST was good but cloudant scalability and geo is expensive.

My needs/background.

1x Ubuntu 14.04 (2x cores, 2GB RAM) VM with NodeJS/NGINX fort the login API that saves to a heavily memory optimised database. Permissions are granted for the MongoDB cluster on a seperate server.

  • has user prefs table
  • log table
  • app related data in a few tables

1x Cachefly File CDN for image uploads.

1x Cluster of MongoDB public data with 3 server nodes in the cluster. The user logs into the login server and gets a return set of saved prefs and API token to other servers.

I thought putting the public user data in a mongo cluster would prevent hits to the login server.

I may have to spin up a server to sit above he mongo cluster?

Q1) would this void the benefits of mongo scalability?

It would be nice if Corona had a native mongo driver like MOAI. There are lua recompiles with Mongo support but not mobile device compatible.

Possible solution:

https://github.com/mongodb-labs/mongorover

and 

http://api.mongodb.com/lua/0.1/index.html

:slight_smile:

You would have to use Lua sockets and write  your own driver. We certainly don’t have one. Someone out there might have written one. Generally though direct access to your database is a security risk.

Rob

Thanks

I have a distributed set of servers to manage the workload and minimise risk and maximise the platforms strengths (I though).

CouchDB on cloudant was all HTTP based and assigning permissions and hitting via REST was good but cloudant scalability and geo is expensive.

My needs/background.

1x Ubuntu 14.04 (2x cores, 2GB RAM) VM with NodeJS/NGINX fort the login API that saves to a heavily memory optimised database. Permissions are granted for the MongoDB cluster on a seperate server.

  • has user prefs table
  • log table
  • app related data in a few tables

1x Cachefly File CDN for image uploads.

1x Cluster of MongoDB public data with 3 server nodes in the cluster. The user logs into the login server and gets a return set of saved prefs and API token to other servers.

I thought putting the public user data in a mongo cluster would prevent hits to the login server.

I may have to spin up a server to sit above he mongo cluster?

Q1) would this void the benefits of mongo scalability?

It would be nice if Corona had a native mongo driver like MOAI. There are lua recompiles with Mongo support but not mobile device compatible.

Possible solution:

https://github.com/mongodb-labs/mongorover

and 

http://api.mongodb.com/lua/0.1/index.html

:slight_smile: