Answer the question
In order to leave comments, you need to log in
How is the VKontakte file system tripled?
I apologize in advance for possible shortcomings in the question, I'm still a beginner.
I recently started creating my site, and I became curious about 1 thing: if there are millions of user accounts on VKontakte, then it turns out that for each of them there is a separate folder / file on the server, to which you can go through the address bar, or it is implemented through a forced change in the state of the address bar itself through some scripts (say, using the history api). Just creating a bunch of separate files for each user would be at least inconvenient. Please explain how it all works so I don't make mistakes in the future.
Answer the question
In order to leave comments, you need to log in
The address bar does not mean the path through the "folders" on the server for a long time. This has not been used for a long time, but they use routing.
The address bar is divided into component parts, which can mean anything. It depends on the imagination of the developer. For example, https://site.ru/books/1
Here you see the main domain site.ru , then the section books , and 1 is the number of the book.
In this path, the site may not have either file 1 or the books folder at all. And the code of the books route will be launched, which will execute a query to the database and get the data of the book with id - 1.
if there are millions of user accounts on VKontakte, then it turns out that for each of them there is a separate folder / file on the server
https://httpd.apache.org/docs/2.4/mod/mod_rewrite.html
For understanding the technique.
There are also terms "single entry point" and "routing".
Technical implementations may vary.
I don't know exactly how VK does it. Maybe some modification of nginx & fast-cgi
i.e. there are not thousands of files. the query string is parsed by the server software and the necessary actions are performed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question