nodejs with solandra connection - node.js

How to connect nodejs with solandra?
If it's possible provide some example code
I want to learn nodejs with solandra.
provide some sample code or some urls

Since the Casandra side of Solandra is really just a rework for indexing purposes I'd expect that the Solr interface should still be in tact.
Therefore, you probably want to take a look at https://github.com/gsf/node-solr.

Related

Can I use a different db as a Wolkenkit read model?

I like MongoDB ok, but I was thinking about just using postgres as the read model and querying from it with graphQL. Do I have to write an adapter to do that? If so, where should I look to start?
As always, it depends 😉
Short answer: No, you can't.
Long answer: Yes, theoretically changing the read model database is possible, as wolkenkit uses an adapter-based approach. Right now MongoDB is the only implemented one, but it would be possible to write one, for whatever datastore you want to use.
Basically, the place to start is the wolkenkit-broker, which is the public API server for wolkenkit, and which also handles reading models. At the center of this there is the so-called modelStore, which acts as an abstraction layer over the specific implementation, such as the modelStoreMongoDb adapter.
GraphQL again is currently not supported out of the box. We use our own approach, implemented in the tailwind module. The place to start here is the HTTP server API.
Please note that I am one of the developers of wolkenkit, so please take my answer with a grain of salt.

Express.js and Neo4j

I have seen alot of examples of how to integrate express.js and mongodb. Does anyone know a good way to integrate neo4j and express.js?
I have been playing around with node-neo4j and I am able to return cypher queries to the terminal. However, I am confused as to how to post the cypher query, in json format, to the local host.
Thanks for your help.
In order to reply simply to your question, there is an express module for Neo4j, here :
http://expressjs.com/guide/database-integration.html#neo4j
It will remove you the burden to format the json correctly for preparing the statements.
Repository is here if you want to see how it is used inside :
https://github.com/hacksparrow/apoc
Maybe you can contribute to it, for the quick look I did, I see that there is no support for 2.2 auth extension, so you may want to make a PullRequest in order to improve the library.

Use Socket.IO to update data in real-time?

I am writing a nodejs / express / mongodb based web application and all is working great.
What I've made for learning purposes is a twitter clone.
People can tweet whatever they want and it will show up on their profile and anyone who follows them stream.
On my home page it shows everyone who you are followings posts.
I want this stream to automatically update when someone they are following posts something new.
So they can just sit their on the home page and see all new posts come in in real time.
I've worked with Socket.IO in the past and loved it for it's awesome simplicity of use.
But is Socket.IO an appropriate use for this sort of situation?
Are their better options I can use, perhaps going with a simpler approach of AJAX polling would be more efficient for scalability?
So basically what is the best to use for an application like this?
I need:
Realtime updates to the client
Scalability and effeciency
Thanks!
You have multiple option
My firstoption RacerJS
and Socket.IO
Get data from mongodb and send through racerjs or socket.io
RacerJS is synchronization model built on top of ShareJS, which has underlying technique called Operational Transformation, this is used to do collaborative work on the same data in real-time (like Google docs) I guess it does not really apply to your case or its not the case where it should be used. Because ShareJS does a lot of work to keep clients able to edit at the same time on the same data. This is not the case with Activity streams like your case.
A good option would be Meteor

searching and retrieving data using node.js?

I was wondering is node.js good fit for searching massive amount of data, i know its main use is for asynchronous sceanrious like chat, ftp and real time etc. I was thinking of using node.js with mongodb to search 300,000 records of books for the library at my university, and see if it would oppose to using php & mysql. any advice would be great thanks.
Node.js would be a fine application interface for searching data .. but practically, so would PHP or many other languages :).
Your backend data storage solution (MySQL, MongoDB, ..) is a harder choice and really depends on the how you want to index and search the data.
If your main goal is search you probably want to look into a search application based on something like Apache Lucene. These typically use a relational database backend, although some newer efforts like ElasticSearch do have growing community support for ingesting data from sources like MongoDB (ref: MongoDB River Plugin for ElasticSearch).
Since you mentioned book search and libraries, you might also want to look into ILS (Integrated Library Search) applications which may already solve that problem. There are several open source products such as Koha and Evergreen.
Look at MongooseJS
Absolute perfect fit in my opinion.

node.couchapp.js & cradle - complementary or tools for same thing?

I want to start testing CouchDB and Node.js but having problems to figure out what tools to use.
Can I do everything I want with cradle and node.js? Or do I need node.couchapp.js? Also is this follow application re-implementation of something cradle does too?
Some birth pains still visible as CouchDB and Node.js are both pretty new, and tools and utilities are still evolving. Relying on some random github projects is not amusing, so trying to keep these dependencies low.
cradle is for talking to a couchdb, inserting and getting documents and so on. couchapp is for something else, you can use it to put some logic (views) or even entire webinferfaces with images and so on into the database. You'll probably need both.
CouchDB has a simple HTTP API, then you can use any HTTP client library to talk with CouchDB. Cradle is sometimes handy, sometimes not, depending on the use-case. The important thing to keep in mind is that, whatever library you choose as CouchDB client library, you can always fall back to using "pure HTTP", and it's often very easy to do: it's only JSON and HTTP.
For writing couchapps, the reasoning is the same: you can start as simple as writing a JSON with the design document and PUTting it in a db; you can use a minimalistic tool as node.couchapp.js; or you can use something more sophisticated as erica. However, under the hood, you are always doing simple HTTP calls to send and receive some JSON.

Resources