T
For example, there is a request for OBD, its results can be retained in Redis in the form of JSON, and the following applications will already take it from Redis and, where necessary, make the cash disable. - How right is that?100 per cent, but the timely handicap of the kash is a pretty big shuttle.Is it worth keeping data in JSON?In fact, I'm a little bit of a Corobiter to keep this line, but there's no specific choice, and it doesn't have to affect anything at all.We sometimes need a page encrypted not only in JSON, but a piece or a whole HTML. - Is it right to keep these pieces in Redis?No, you have a SPA, all the rendering should be on the client.There's an idea to implement a session-storage in Redis, how to do it right Is that right or not? How will it be better?If your session is considered to be a permanent repository, it's not right because Redis is not meant to keep the data permanently (whether he can turn the data on the CD from time to time). Instead, it is better to organize a two-tier (or even three-level) repository from Redis-OBD (In-Memory - Redis-OBD in the case of tri-level interconnections).In which case should the cash be recorded in the CD files?Normally, there's a database. There's a way to throw the results of the heavy requests so that all their legs can be seen, but even in this case, I'd organize an interim Redis-Slave.Shouldn't we be drinking what's described in redis?The more you hang in the cash, the better, but you watch the number of melted operational memory from time to time.Maybe there's some guidance on working with high-load sockets or something on the basis of such a project.Remember two things.The project has to be scaled up horizontally, i.e. simple addition of new servers. It follows that changes on one server should be visible to all others (this is achieved through the use of one Redis and OBD)There's a thing like dogpile effect, which means a bunch of users who at the same time request the same resource. In the case of the three-level repository described above, 100 simultaneous users are not detected in the cash and are laminated (all 100) to the OBD. In the case of 20 simultaneous connections in the OBD system and each request takes 30ms, the last user will receive data not before 150ms (which ideally is, in fact, there would be a considerable amount of data.Oh.That's not good.