I
I
Igor Bezlepkin2016-05-16 17:36:08
PHP
Igor Bezlepkin, 2016-05-16 17:36:08

What is the best way to store data received from the API in a contact?

Hey! I'm doing a search in my database for the existence of users in it who have registered from under the contact.
A request is made to the contact API, returning the user's friends by the given id. Everything is good here. But then I need to query all friends of each friend. Here it turns out a monstrous volume of data and cycles.
I thought when registering a user, immediately enter the list of his friends into a file, and then extract it from the file. I heard that they do such things with redis.
Please tell me the best way to do this. As a result, when searching for friends and friends of friends, you need to check for their existence in the system.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Mirilaczvili, 2016-05-22
@2ord

It is better to use graph DBMS - they are just created for such cases. For example, ArangoDB

A distributed free and open-source database with a flexible data model for documents , graphs , and key-values ​​. Build high performance applications using a convenient SQL-like query language or JavaScript extensions.
and others.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question