📜 ⬆️ ⬇️

Good, bad and evil ... cash



Quite an interesting video (in English, unfortunately), in which the girl, on the example of social networks, talks about the pros and cons of caching in web applications.

The most informative are the first two thirds of the video, which can be summarized as follows:
')
1) there is a lot of data in social networks now, they are updated frequently, and the user needs to provide them quickly
2) therefore not to do without caching
3) further shows how caching (conceptually) works in Twitter, Facebook and Reddit
4) but there is a problem ...
5) caching in each social network project is manually unsubscribed
6) as a result, we have a lot of code that does almost the same thing in every project. And a lot of code means a lot of bugs and human labor.
7) and what to do with it?

8) use the database! Type SQL. Users in social networks work with timelines, and each such timeline in the database language is expressed by a simple request
9) the result of such a query is a label that is cached by the database itself and automatically updated as the base tables are updated, on the basis of which it was calculated
10) but here again the problem ...
11) modern database implementations are not so smart that they can be used in the form in which they are offered
12) they are centralized, they cannot be taught the semantics of the application, it is impossible to make friends with the client cache and ... I particularly liked the following shortcoming. I will even highlight it in a separate item.
13) academic science has long since decided everything, but for some reason the developers of the database are stupid and lag behind progressive humanity by three decades (the wording is free, but I can't just pass by this rather naive, in my opinion, judgment)

The rest of the video seemed quite muddy to me. The girl tells what to do with the database so that everything “flies”. Unfortunately, she does not offer any specifics, so I don’t even know what to write here about this part of the video. So see the video. However, in a nutshell, then:

14) “fat” customers will save the world (who should “carry” on themselves a significant part of the application) and
15) client side caching consistent with server side caching

In general, the answer to "the main question of life, the universe and all that, " as always escaped. The most interesting part of the conversation was empty. However, I still recommend the video because The formulation of the problem is given quite clearly and clearly. Besides girls in IT is great. We should be very welcome.

If, nevertheless, to discuss, then the offer to use "fat" clients may seem rather nontrivial. This is something that, for example, Intel would really like, which obviously would not mind having a high-performance general-purpose processor in every computer again. However, the world is still moving in the opposite direction. What will happen in the future is hard to say. Perhaps there really will be some killer applications that will make us all buy irons again. Who knows…

About SQL everywhere - the idea is tempting and excites many. It is possible that it is in social networks, after some improvements, that it will take root. Still, whatever one may say, social network queries to the database is a relatively simple thing. The variety of requests is small, and they are not very complex. Therefore, in my opinion, you can even allow yourself not to use any databases, but write everything manually (as, in fact, now it is done). Those. the very “many code” that the girl complains about, it seems to me, are not at all the “super code” that you would have to write for the optimal operation of systems that process hundreds or thousands of heterogeneous requests. Here, just, it is difficult to use a ready-made database. It is possible to optimize it for some class of requests, but requests from another class will constantly go past the caches or, good enough, generally destroy caches. Apparently, the author of the report would answer that he also wants to “marry” the database with application semantics. But she does not say how to do it, so there is nothing to discuss here ...

Here, it seems, and everything ...

UPD: article is devoted to caching problems. Therefore, I removed the reasoning on the topic of Java Script (for some reason, it was they who attracted the attention of all those who unsubscribed). I do not like holivary ...

Source: https://habr.com/ru/post/234041/


All Articles