Hello everyone. My name is Zhenya, I am a full-stack developer in the VKontakte advertising team.
In this article I will tell you about the high-load space in the VKontakte advertising account. Any developer can face a similar situation in his project. The material will be useful not only for those who are engaged in the backend, but also for all IT specialists who strive to make their products fast and fault-tolerant. Spoiler alert: there will be no code in the article.
Now I am mainly engaged in the development of a mobile advertising cabinet, but from time to time I have to solve diverse tasks. One of these is to display a 30 by 30 pixel preview of your ad in the ad table.
It seems, what's wrong with that? I added an additional field to the request to the database, sent the resulting link to the picture to the front and rendered it in the column. Looks simple: 30 lines of code and 20 minutes, including a trip for a cup of coffee.
So let's go!
Step 1. Getting the picture
. : , , , , , , , , — .
. , , . , -. , , . , .
2.
, , , , , . , 30 × 30 . — . . : , . .
3.
1 000 . — . - id . memcached. memcached. , .
4.
: , .
5.
, . , , 1 000 , . . , . — . 20.
6.
: 1 000 , 20 . , 20 . , , 50 . .
: , 20 memcached, .
: ? : - . — , . , . .
7. , ?
. , 100% , . , . : , .
8.
- ? , , memcached .
, ? , , , . . . .
9.
. .
10.
, , -.
11.
: , , . ! , , .
12.
.
, ... .