E
E
Eugene2014-11-15 23:14:11
Database
Eugene, 2014-11-15 23:14:11

How does the principle of generating paths to images on large resources work?

Good day!
It has always been interesting how the principle of generating paths to images on large resources works.
For example, here is an image uploaded to Google servers: https://lh4.googleusercontent.com/-mO4Blz8vzOc/VGe... :
/-mO4Blz8vzOc/VGepZf9-YMI/AAAAAAAAGHQ/jaNAMhEHLZE/w426-h568/IMG_20141115_125511.jpg
Consider the path more.
The first directory is named -mO4Blz8vzOc . What is it? Do they have hundreds of thousands of directories with different names at the root? In my projects, which have a lot of content, I break everything into directories, for example, I take the image ID, break it into parts and form the following structure: /153/391/255/
You can also see AAAAAAAAGHQ on the way. Why so many letters A goes and not, for example, Z?
I understand that I'm asking stupid questions, but still very interesting, I can't sleep well... Do you have any ideas?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
throughtheether, 2014-11-16
@Qwofer

Do you have any ideas?
I will express a couch opinion (I don’t know how Google works).
The first directory is named -mO4Blz8vzOc. What is it?
I guess the term 'directory' is not quite appropriate here. I don't think that for every part of the URL enclosed by '/' there is a file system directory with the same name. I think the letter sequences (VGepZf9-YMI,AAAAAAAAGHQ,jaNAMhEHLZE) are generated by hashing and can be used to select the destination storage server (load sharing/balancing). But it is interesting to know the opinion of people with working experience.

S
Sergey Lerg, 2014-11-15
@Lerg

Don't bother too much. Identifiers are random. Divided into subfolders to make it easier on the file system. AAAAAAAAGHQ - most likely an ordinal identifier, over time, the letters A will change for new photos.
w426-h568 - width and height of the image.
Yes, they have a lot of directories and files.
Instead of just numbers, the entire alphabet is used to shorten the length of the url.

W
Walt Disney, 2016-01-18
@ruFelix

It's not a path, it's a URL that encodes information for optimal image retrieval from storage.
mO4Blz8vzOc - most likely hash
/VGepZf9-YMI/ - most likely two IDs
AAAAAAAAGHQ and jaNAMhEHLZE - these are most likely just numbers in the 48-decimal number system
w426-h568 cantinka size 20141115
- like creation date
125511 - some kind of crap Distributes
pictures on large projects software they can not just be taken and distributed from the folder

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question