M
M
Maxim2018-08-12 01:25:37
Database design
Maxim, 2018-08-12 01:25:37

What is the best way to deal with data storage?

I need to make a profile of a person, which will indicate the areas of activity. These areas of activity a person chooses from the list himself. That is, there is a table of data on directions.
If I use the VK API to get the user ID, full name and picture, do I need to store them in my database so that this user can use the service?
The question is that I do not want to store a person's personal data in my database, but I doubt that the system will work.
Situation
Many people have started using the service. Will they be able to find each other through a site search if the data received through the VK API is not stored on the site?
If you use the usual registration and authorization system using a database, then the question is excluded, since all IDs and other key fields will be stored in my database, and I can easily set up links and so on. But if you do everything through the VK API, will you need to store data or how will it work?
Relatively speaking, through VK, authorization on the site is going on: will a person be able to maintain his profile (choose directions), will others be able to search for him (subject to a search being made).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sokolov, 2018-08-12
Epihin @mepihin

If I use the VK API to get the user ID, full name and picture, do I need to store them in my database so that this user can use the service?
No. Keep only the ID. To display user data, request a picture and full name dynamically from the interface, directly from the visitor's browser.
Will they be able to find each other through a site search if the data received through the VK API is not stored on the site?
Depending on what signs to look for. According to the "areas of activity" - they can. They will receive a set of VK id, display their avatars, full name and links to profiles.
It seems to be simple. A person comes in. to the website. Presses the "Login with VK" button. Your server makes sure that a person has entered with such and such a VK id. Create an entry in your database with this id or update the date of the last visit. You save the “directions” chosen by the visitor in your database in a table id, id-vk, id_naprav(or you can get by with two columns, without a simple id, declaring the primary index to be two-column).
The search goes only by interests: all records are needed, where id_napravone is from the list. Collected id_vkthat meet the criteria. Sent to the interface. They asked for avatars and full names from VK for these id, showed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question