I am developing social networking website now a days. for that I am using MySql
as my primary database and neo4j as in-memory database. I am using node.js and
(for neo4j)
too.
Now I have a some doubt regarding data modelling for neo4j. I want to give some feathers
to my users like friends suggession, mutual contacts and searching. This all stuff I have
implimented with My-Sql. But due to some performance issue, I would like to store
friends and it's relations related data in to neo4j.
For that I have stored my User's nessessory information into neo4j as node.
I have already primary key in mysql database. and here neo4j also have it's own id system.
So how can I bind this both ids togather.
I have read this blog (https://github.com/aseemk/node-neo4j-template/blob/master/models/user.js)
and trying to do as he mentioned in his blog.
Second thing is How to give suggession list to my user from neo4j database.
Right now I am giving UserName with his/her Image and mutual friends count (with login user)
and city in suggession list. I don't understand How I do this with neo4j within node.js?
I have read many blogs and watched many videos over internet. but still I am not getting any idea to do this work.
Can some one help me or can suggest me to where can I get proper information regarding this? I am very much confused and frustrated, and not getting any clue to achive my task.
Sorry for my bed English.
For your first question, take a look at http://blog.neo4j.org/2013/04/data-migration-between-mysql-and-neo4j.html and see if you could apply similar principles.
To send back suggestions based on your Neo4j model, you could consider exposing a REST api for example, which basically operates over your graph database by querying/collecting information and then returning it. Your application then just talks to the API rather than deal with two underlying stores.
As you've already figured out, the driver for Node.js is https://github.com/thingdom/node-neo4j and you can use that to talk to Neo4j.
Perhaps you could provide more details on what exactly you're stuck with?
Related
I've got a question related to oracle database and working with an API/web service to extract data from said database for use.
My experience in the area is limited so I'm hoping for some discussion here about it. My goal is to create a web service that has several fields and the should all fields submitted match an entry in the database, the program should return something positive, lets just say "true". If false, it will identify that there is a problem with the input.
My understanding right now is I can first use an API to expose the data, which I can then manipulate and query-check with a web service? Correct me if I am wrong with this general/overall plan. Moving on from this, if anyone have any relevant advice or programs that might prove to be useful here, but the main goal of posting this is to get a high-level understanding of the process.
Also, the plan is to use REST/JSON services here. Thanks all.
I am also not very skilled yet but if I correctly understand your question the answer could be ORDS
I found many essential informations here
With ORDS is possible to POST a request associated with a store procedure that do all the validations that the client can't do.
I am trying to build an API first web app that has two parts:
Part A: The Project Management App. This would be built using php/mysql. One of the table in the mysql DB will be the users table where all users information will be stored viz username, password, email etc.
Part B: The online chat App. The users of the project management system will be able to chat among themselves. This will be built using nodejs/mongo. The mongodb DB would store the chat transcripts of each users and so would have a users collection containing the user details. The users collection would contain the same user information that the mysql users table has viz username, password, email etc.
Now, i have a couple of questions in terms of the architecture of this app.
Question 1: Is it at all a wise idea to maintain two different sources to store the user's information? The reason why I wanted to have a replica of the users table in the MongoDB as well is because since there will be too many reads and writes happening in the chat app so its best we use a nosql DB. (Lets assume here that my app will be used heavily going forward)
Question 2: If the answer to Question 1 is "Yes", how do we make sure of data consistency? I have thought of two approaches to achieve this:
Option A: Since we are using the API first approach, so during the registration of a user when the CREATE user api call is made, it will add the user in both mysql and mongodb databases.
Option B: I setup a cron that will sync the data between the mysql users table and the mongodb users collection periodically.
Can someone please throw some light on this and tell me if my approaches are right and that if I am going towards the right direction.
Many thanks
I have an application which is currently tied to the desktop application which will specific to each of my users.
The Existing application has about 300 table
The current database design is specific to a single user. For example , for a given clinic as user , we have following tables
• Patient
• Patient_address
• Patient_Images
• Employees
• Clinic_details
• Devices
What I want is to host this database on web. I want to use this database for multiple users and need to be able to store and retrieve data on a user unique key(Let’s say user ID)
The database will be local as well as cloud based i.e. I would like user to continue work even if they do not have internet, and be able to sync it on demand when connection is back, I may also choose to run a nightly sync process on user desktop.
What is the best strategy to do this? Currently I’m using MySQL, would it help if I switch to SQL?
Any help in this is appreciated.
Thanks
Bhim
P.S. - If this is not the right forum, please suggest the right forum for this question.
MySQL is SQL. You cannot switch from MySQL to SQL. It is like saying that you want to switch from Espresso to Coffee.
If you want the ability to work offline and sync when the connection is back, be prepared to be working on that little feature for the next couple of years or so. I would say, do not even try.
For storing all of your "users" in one database, the term you are looking for is multi-tenancy, and it is a big subject, not suitable for a stackoverflow question and answer. So, multi-tenancy is the term you want to google for in order to find information on how to achieve this.
I'm new to webdev and I'm trying to use passport for registration/authentication on a site I'm setting up. I'm also going to write an application in node later on that will be using some of the user data (users will need to provide an API key for an account on another site that I will use to pull data into the application).
At the moment, the main issue I'm having is figuring out what goes where. I've found plenty of resources that explain how to create an app using passport, but nothing shows how it would be incorporated into your website or where the files should be in relation to your website. I'm relatively new to Node.js, and while I've written a few small applications I have never hosted them anywhere.
Bonus question: I'm using MongoDB with passport and I was also planning to use it to store some JSON my application will be receiving from API calls. However, I wanted to use MySQL to store some data as well. More specifically, I'm planning to save the raw JSON then I'll create a relational database out of the data I need from the JSON and then keep the rest in MongoDB for easy access. Is this common/smart, or should I focus on keeping everything in my MongoDB? I'm relatively new to NoSQL.
Thanks in advance for any help.
I would reference this tutorial. I just recently used this to help myself with a new application. Also there is an example of the same thing but in SQL here. So not sure what you mean by " where the files should be in relation to your website". The information related to to authentication should go in your database.
To your "bonus question" you can use two databases. The key here is to ask yourself why and what are the true needs for data, and how is this data accessed and used. From ground up I would like one and stick with it. If at some point later you realize a certain type of data would be better in a different database then you can add it.
Side note: look into an IDE such as webstorm to help you out.
One of my sites is a social networking site running on MySQL. I use postal code and country information to geolocate users using a webservice. This webservice also allows you to download all their many tables of information so that you can access it locally. My site has gotten big enough that I wish to do this now.
My question is, should I create a new database on my site for all of this postal code and country information and all its tables, or should I incorporate those tables into my existing database for my social networking site?
What are the pros/cons either way?
When you're talking about scaling and want to know about other databases like NOSQL, you might find this article interesting: http://highscalability.com/blog/2010/12/6/what-the-heck-are-you-actually-using-nosql-for.html
I'd vote in favor of a separate database if you planned to use the data as read-only and put a web service in front of it to access it. Users would search it based on a small handful of parameters (e.g. address info to get lat/lon data).
I'd say put it in the existing database if you planned to JOIN it with other information in your current schema.
it will live on the same disk probably.
so disk space is not an issue.
if you query the tables in a completely separate manner, then no impact on the existing site.
if you query things together, then easier when all in one database.
overall administration of one database vs 2 is easier.
i think it's a no brainer... they go in one db.