What is the best design for social sharing network based on phonebook?
Background:
App sync the phonebook of a contact and social network of a user and build a graph and give recommendations.
Use case:
1. Recommendation of friends, mutual friends to people in your phonebook.
2. Initially not many nodes user connects to has social linkage therefore it may be the
case you have lot of friends but very few of them are social friends. Does it make sense
to have new relationship for every social ID (be bbm, FB, linkedin)
3. We will build the network through which old user gets notification when new user joins
any of social network and register to our app.
4. Pick of the day - based on mutual friends (degree and social interest and country), user
can search country wise social IDs.
5. User always search people from 1 country or its connected node (upto 4 degree) based on
male/female and age filter.
6. Status update would be notified to other connected nodes with social IDs.
Schema:
Country (1 relation or bucket per country).
Friend (all people who are in phonebook) - phonenumber as a key.
Social friend (1 relation or bucket per social networking company - will update the relation as soon as someone from your phonebook updates the social linkage on our site).
1 relation for male - help for filtering and pick suggestions.
1 relation for female help for filtering and pick suggestions.
Does it make sense to also add friends and social friends as a relation?
Usually you would do something like this:
(u:User { phone : "phone#" })-[:ON_PHONE]->(u2:User { phone : "phone#" })
(u:User { phone : "phone#" })-[:KNOWS]->(u2:User:Facebook { phone : "phone#", fbid: "fbid" })
If you want to keep the record information where the social network connections came from you can add the additional links to your graph like this:
(u:User { phone : "phone#" })-[:KNOWS_ON_FB]->(:FacebookUser {fbid:"fbid"})<-[:ON_FB]-(u2:User { phone : "phone#", fbid: "fbid" })
I think in most cases you don't need keep the records and should just focus on the "realtime/current" structure of your graph that you can update.
You can add additional labels to your users if you have facebook, linkedin etc. information for them and then add additional indexes:
create index on :User(phone)
create index on :Facebook(fbid)
Related
it is possible to authenticate/login users on the app using their company employee number or through a secondary email ID.
Okay, let me try again,
I have managed to implement login via, email+password and phone number+OTP. The following data gets stored in the firestore database:
First Name
Last Name
Primary Email (this email is the charity domain email)
Secondary email (user’s personal email like google/outlook etc)
Phone No
Employee no (employee number given to each volunteers in our charity, normally a six digit number)
Now I want to implement options to login via stored secondary email or employee number.
I have come across linking accounts methods, but they mostly relate to social media/google accounts linking.
I want user to be able to login with secondary email or employee number + password they chose when registering the original account.
I hope it clarifies my question, and thanks in advance to anyone who could help me or point me in the right direction.
SignalR has me stumped! I have a list of growing items...that once updated in the database I want to let certain users who "care" about it know.
I don't really care of they are online or not. I just want to trigger a message out to all users who want to know about a change. If they are online, then they see it. If they aren't then it just shows up later in another set of notifications that they see once they log in.
All I have about these users are their unique guids (primary keys in their table) and then information, such as: name and email.
Is there a way to use Clients.Users(list of users) in this scenario by alterating information that I already have?
Clients.All.SendAsync works perfectly. I just need to really nail down this situation.
I hope that this is clear enough to get me going down the right path!
I am using AspNetCore.
Example information that I have to work with:
User1
UserGuid - b7c103d0-78c0-43de-aaa0-1a07cb0c8e46
FirstName - John
LastName - Doe
Email - john.doe#mail.com
User2
UserGuid - cd75274b-19bc-4b8b-8eca-89947959ab03
FirstName - Jane
LastName - Doe
Email - jane.doe#mail.com
User3
UserGuid - df8ede1b-dada-4eec-bc6c-f32b70bd8bd9
FirstName - Bob
LastName - Doe
Email - bob.doe#mail.com
What I want to do is send messages to User1 and User3. How do I determine the user information needed for signalR to trigger a message to them only? I don't want to send a message to all
You have a couple questions here that are trickled down based on some other knowledge.
Some users care about x, y, or z. - You need to associate your users to what they care about, such as in a database table. How you know that is going to be based on how you create/setup users and how they know about x, y, or z.
How to send updates about x, y, or z to just users that care about them. - You can use groups. When a user logs in, get what they care about and add them to that group. When they log out, the get removed from the group. You can send to them using Client.Groups("x").method(message) where "x" is the name of the group. This will send to every member of that group.
If they aren't online have it show up later. - This one will require storing your messages and group they should be assigned to in a database. It get's trickier because now you will also have to track if User 1, 2 or 3 has seen a particular message or not. Your going to possibly need to do some additional research on this part. But Google and Stack have plenty to offer.
Am looking at the data structure in this post and want to know how you would go about getting the emails of users who belong to a certain group when they could belong to several groups and the GroupID stored against that user is the current group they are participating in?
Do you store the email addresses with the userid under the "members" or, instead, for each member of the group, get that user's email address from the "users" document userid (this would mean iterating through the group/members collection and doing a query for each user. Not very efficient).
Am used to SQL so this is all new to me.
You should have a single node for each user
/users/UID/emails/
/users/UID/emailunread/
/users/UID/settings/
/users/UID/details/
/users/UID/payments/
So you can simply do a subscription for a singular node path this.myDatasubscription = this.DB.list('users/' + this.uid).snapshotChanges() ensuring changes like new emails or account settings will detected and rolled out in real time back to the app, so your are using angular/ng or something similar client side then your variables {{this.email_list}} should update real time with no page changes.
Take a look at this one.
error: Property 'getChildren' does not exist on type 'DataSnapshot'
I'm working for a big professional social network and we are starting to check if OrientDB meets our requirements in terms of Social Graph. For now on, we have managed to deploy a cluster of 10 nodes, setup backups and restore and populate all of our data from MongoDB to OrientDB with no major issues.
Our data model is :
vertices :
Profile
Company
Job
Publication
...
edges :
Followed : one profile can follow another profile or a company
Applied : one profile can apply to a job
Posted : one profile can post some publication on the network
...
What I want to know is :
How to get all people connected to one given profile at depth 1 or 2. I've tried something like SELECT out('Followed').out('Followed') as friend FROM 14:4 where 14:4 is a Profile object. Unfortunately, it gives me Profiles as well as Companies since a Profile can "Followed" a Company. How can I filter to get Profiles only ? I've tried SELECT out('Followed').out('Followed') as friend FROM 14:4 where #class = 'Profile' but it does not work :( Should I have multiple edge classes (FollowedProfile and FollowedCompany) to ease queries ?
When a Profile creates an account using another Social Network (Facebook, Google, ...) we are storing his existing contacts and match them with our database so we can say "Profile A is connected to Profile B thanks to Facebook". How should I represent that in OrientDB ? An attribute on the edge or a dedicated edge class ?
Last one is : how can I get the shortest path between two Profiles ?
Thanks a lot.
1) You can try with
SELECT FROM (SELECT expand(out('Followed').out('Followed')) as friend FROM 14:4) Where #class='Profile'
2) I think An attribute (thanks) on the edge is better
3) You can use shortestPath function (http://www.orientechnologies.com/docs/last/orientdb.wiki/SQL-Functions.html) :
Example:
select shortestPath(#8:32, #8:10, 'BOTH')
I see lots of examples some even with great details on how to apply claim based authorization for resources.
Unfortunately, all are aimed to a specific resource so you do something like :
GetEntity(int id)
CheckAccess(id, user);
Then in few examples I see the permission/claim for the action
GetEntities()
where you have a true or false access to the result view. (which is ok)
What I don't seem to find or understand, is how on a GetEntities action, I can return a list of entites and get the permission of the data using claims.
Practical example:
I have a shared address book for some X users in some group.
So group 1 have contact A, B, C
user 10 have permission to list contacts of group 1
user 10 have permission to see full details of contact A and B
user 10 have permission to see basic details of contact C
So I will end up showing in the view something like :
Contact A: name, phone and address
Contact B: name, phone and address
Contact C: name only.
Another thing is not quite clear, is where in the database should I store and how claims so I can later filter the result set from the database.
Let's say user 9 don't have permission to list contacts of group 1 but 2.
How is this claim stored and used to filter results on query ?
I know this is a pretty basic question, but i just don't get it!