Would it make sense to use Meteor when you want to replace MongoDB with a solution like ActiveResource for Rails? I'm still figuring out if this is doable and makes sense.
Basically what I want to do is couple Meteor to an external API, but still keep it's features like latency compensation, live updates etc. But I can't seem to find any examples, other than: implementing the DDP protocol. But I don't want Meteor to have direct access to MongoDB (or whatever DB is behind the API). Which would mean it should be built into the Meteor collection.
Any tips?
Related
I'm planning to work on a social site and I would like to leverage both a document and graph database for all of the desired features. Is there a way to get Meteor.js or Sail.js (or any better) to work with ArangoDB or OrientDB? Or should I just stick with the bundled MongoDB and integrate something like allegrograph DB?
Sails.js has support for both of the databases you mention:
https://www.npmjs.com/package/sails-orientdb
https://github.com/rosmo/sails-arangodb
In addition to MongoDB, Postgres, and dozens of others.
Sails.js is a classic mvc client-server web application framwork, basically its ruby on rails implemented for node.js + webscockets, so mostly all you need to make it work with any backend database is make changes to the orm.
Meteor is a very different beast, it is a very opinionated realtime end to end web framework including client server and database, by behing very very opinionated it solves many of the common issues in realtime application, where you need to implement a mechanisms for very quickly updating all your clients of each others actions and take care of things like latency compensation, data collision resolution, and real time client version managment, This is implemented by using web sockets and the mongoDB's write ahead logging for triggres of data updates, making meteor somewhat coupled with mongo.
But you can make orientdb work pretty well with meteor using the new orientDB live query api. It is a pubsub implementation for query results, and can be used for efficent updates pushed from the db through the server directly to the client with very little overhead on the server. This is far from production ready and only currently works on the orient db 2.1 rc5 version.
I have implemented a small meteor demo application as an example https://github.com/imdark/meteor-orientdb-demo
Please check on Meteorpedia the Alternative Database Post, they mention neo4j-livedata and minineo4j.
Here is the Atmosphere package: ostrio:neo4jdriver
Is there a specific economic or technological reason why you consider not to use the very well integrated mongoDB as the database of choice?
In addition to Travis answer I also recommend waterline-orientdb for Sails.js.
Is it possible for Meteor to use RESTful db driver instead of Mongodb?
I have started studying Meteor and I want to use it in a project I am working on. The problem is that this project uses MySQL. I want to keep using Mondb syntax for CRUD operations but instead of using the Mongodb database I want to use RESTful for a PHP web service.
For example, when I do: Albums.find({'name': 'Atom heart mother'}) I want Meteor makes a GET request to http://server/web_service.php/albums/?query={'name': 'Atom heart mother'}
I don't care if Meteor is still using mondodb for the session, app state and some other stuff.
Thank you people, and sorry if my english sucks
For the moment, Meteor can't be used with SQL directly - the best try at this so far is the meteor-sql smart package, but it's been inactive for a good while. And the meteor roadmap doesn't make SQL integration a priority.
The meteor iron-router does allow server-side routing, so you could potentially link your Mongo calls to server routes this way... but wiring this up to Meteor's real-time data might be tricky.
I'm thinking of adopting Meteor for my hobby project and I'm wondering something.
On one or two websites that were comparing various frameworks listed Meteor as one having both client and server libraries (a better term could be used here, but I can't think of one!).
So my question is...
Where can I find more info about this client library and its capabilities?
Can I drop the default library (whatever it may be) for something like Knockout? Do I need or want to?
Meteor has a database everywhere approach which means that you can use the same interface for accessing your data on both client and server. (i.e. MyCollection.find() would do a find whether you're on client or server.
As for client side libraries, meteor supports adding packages such as other templating engines like meteor-knockout. As well meteor comes with the Handlebars templating engine, which is what is used in the docs. See here
In general, if you want to know anything about Meteor, the docs are the best place to go.
I've got an application where I'm populating a Mongo database. That code is not super easily portable to Meteor, so that I'm doing is running that code in a separate process and writing data to Mongo collections.
In my Meteor application, I point it at that shared Mongo instead of the default instance. The application works reasonably well, but the updates don't seem to happen as fast as I would have expected. When I write a value to Mongo from my external process, it seems to take a while before my client refreshes to show updated content. There is about 7MB of total data in my Mongo database.
Is this approach to share a Mongo and write to it from an external process feasible or is it not advised?
Thanks!
Eric.
As MongoDB doesn't have any live-queries Meteor polls for changes it missed every 10 seconds. Therefore it can take up to 10 seconds until changes are noticed by Meteor.
About the approach in general: it is fine to do so. If you need faster updates you might need to use an other approach or trigger Meteor to update itself (not sure if this is possible at all). Also note that meteor might not support every MongoDB feature yet.
Further readings
Multi-Server architecture and concurrency
Talk at the Dev-Workshop: How Meteor is Scaling Meteor
Lets say I want to use a different DB than Mongo in Meteor's back-end and also want to use a visualization lib like D3.js on the front-end.
Is that possible at the moment?
How complex would it be to add it by myself if not?
Thanks
https://github.com/meteor/meteor/tree/master/packages/mongo-livedata the documentation indicates that this would be the module to start with if you wanted to replace the database functionality.
You can substitute another database for MongoDB by providing a
server-side database driver and/or a client-side cache that implements
an alternative API. The mongo-livedata is a good starting point for
such a project.
-- http://docs.meteor.com/#data
Take a look at this project: https://github.com/austinrivas/meteor-postgresql. If you really need to use a database other than mongo meteor may not be the right choice unless you are experimenting. You can always aggregate data from another db to mongo which might make life easier.
I've been using D3 with meteor in the form of angularjs directives and binding the data to drive the visualizations to $scope. DDP makes keeping the data current in the d3 visualizations super convenient.