Plans of adding these features in MongoDB

99 views
Skip to first unread message

Deepak Kumar

unread,
Jul 9, 2014, 7:17:05 AM7/9/14
to mongod...@googlegroups.com

Hi, 

I've found some of the databases like CouchDB seem to be highlighting the following features in their posts and was curious to understand if these are supported in mongodb as well.

-CouchDB uses HTTP/REST API access. Is there a plan to add such interface for MongoDB for data operations as well as for monitoring.

-CouchDB has a real time change notification API. Any plans of supporting such an API in mongo as well? 

-CouchDB supports Master-master replication and support for offline mode which apparently is especially useful in mobile. I believe mongodb cannot work in an offline mode in a replica set especially for writing since the node becomes a secondary when losing contact with other members in the set. Let me know if it is possible to make mongod work in an offline mode.

-CouchDB supports ACID. I believe this is only supported at the document/aggregate level just as in MongoDB and there is no ACID support in multi document transactions. So, I guess there is no difference here. Please let me know if I am missing something here.


Thanks a lot!

Deepak


Deepak Kumar

unread,
Jul 23, 2014, 3:33:00 AM7/23/14
to mongod...@googlegroups.com
Hi, 

Could somebody please help me here? I am aware of the tons of benefits MongoDB has over CouchDB. However, I am really curious to know how well MongoDB works with mobile platforms that could go offline often?  Does MongoDB have any support for offline mode, triggers, real time notification API, REST API like CouchDB has? Couchdb highlights these features at a lot of places, so it will be helpful to understand their support in mongodb.

Thanks a lot!

-Deepak

Stephen Steneker

unread,
Jul 23, 2014, 9:17:01 PM7/23/14
to mongod...@googlegroups.com
On Wednesday, 23 July 2014 17:33:00 UTC+10, Deepak Kumar wrote:
Could somebody please help me here? I am aware of the tons of benefits MongoDB has over CouchDB. However, I am really curious to know how well MongoDB works with mobile platforms that could go offline often?  Does MongoDB have any support for offline mode, triggers, real time notification API, REST API like CouchDB has? Couchdb highlights these features at a lot of places, so it will be helpful to understand their support in mongodb.

Hi Deepak,

The features you're asking about have also been requested for MongoDB in various forms, and some have alternative approaches available now. I've noted some relevant approaches below as well as server issues in our public issue tracker (https://jira.mongodb.org/) which you can upvote and/or watch. Different products have different focus and features, so I would not expect identical implementations and you need to decide what best fits your use case.

If you're interested in where MongoDB is heading longer term, our CTO Eliot Horowitz recently shared some thoughts in his Roadmap talk at the MongoDB World  2014 in New York City, including the possibility of multi-master databases.

In regards to your specific questions (as at MongoDB 2.6) ...

> HTTP/REST API access. Is there a plan to add such interface for MongoDB for data operations as well as for monitoring.

Direct read/write access to MongoDB uses the MongoDB Wire Protocol, and there are officially supported drivers as a well as community supported drivers for all popular languages.

There is currently a simple HTTP Status Interface API which can be used for monitoring, although if you want programmatic (and more detailed) stats I would write a program to poll information from the serverStatus command. The quickest way to get started with MongoDB monitoring is using the free cloud-based MMS Monitoring service, which includes an agent that gathers interesting metrics every minute and pushes them to your MMS account via https. The MMS documentation includes a list of information collected and commands used by the monitoring agent.

The MongoDB server does not include a full REST API, however there are many third party options listed in the documentation and you can probably find solutions using your preferred programming language / stack. You generally never want to expose your database server directly on the internet, and an external-facing REST API (eg. for mobile apps) would need to be properly secured. Given the ubiquity of drivers for MongoDB, I think a REST API likely makes more sense in an application layer rather than the database.

A relevant feature request for a more complete REST API:

> Real-time change notification API

MongoDB has a concept of tailable cursors which can be used to track changes to a capped collection (including the oplog capped collection which tracks all changes for replication). This isn't exactly the same as a notification API, but there are solutions such as Mongo Connector that leverage tailable cursors to monitor data changes and take some action (for example, integrating with third party search solutions).

Some relevant feature requests:

 > Master-master replication

As mentioned in the MongoDB roadmap talk, this is an area of interest being considered. FYI, multi-master is a broad topic and there are different ways to implement "multi-master" features (MVCC, vector clock, etc) depending on the goals.

Relevant feature request:

 
 > Offline mode

This is somewhat related to multi-master support if you are referring to ability for a node in a replica set needing to be highly available while perhaps partitioned from other members of the replica set. Currently MongoDB replica sets only support a single primary, so there is no provision for a secondary or offline node to accept updates and somehow reconcile those with a primary.

However, "offline mode" in relation to mobile is a different use case: effectively you want to cache data on the device when offline and sync when a network connection is available. You certainly do not want to run a server version of MongoDB on your mobile device as there is limited memory and power. In general what you want is an API which is perhaps similar to MongoDB but takes care of the offline/online state in order to sync data back to a server/API. Depending on what you're after (and how much of the stack you want to host/manage yourself) there are a number of solutions/stacks available that are using MongoDB as a backend (for example: MeteorParse, Firebase, ...).

Regards,
Stephen

William Zola

unread,
Jul 23, 2014, 10:44:44 PM7/23/14
to mongod...@googlegroups.com
Hi Deepak!

In addition what Stephen has mentioned, I'd like to point out that you can have a near-real-time notification and trigger-like functionality by examining the oplog -- take a look at this presentation for details:

-William 

Deepak Kumar

unread,
Jul 24, 2014, 9:25:33 AM7/24/14
to mongod...@googlegroups.com
Thanks a lot Stephen and William. Have to admit -- you guys and other MongoDB support people in this forums are extremely patient and helpful. Great going. 

-Deepak
Reply all
Reply to author
Forward
0 new messages