A "real time" application (such as a chat room or multiplayer video game) needs to be built differently than a "normal" application.
In a "normal" application, you only get results when you take a specific action. E.g. on Reddit, you only receive an updated list of comments when you refresh the page. Compare this with a chat room or messenger app where changes show up on your page immediately as they happen.
In the older days, people would do this with loops. E.g. your website would have a loop running that would ask the server for updates every second or whatever.
These days, we use different protocols such as websockets which mean we don't have to do this loop (also called "polling").
A real time architecture may need to do other things so that the entire site works well on a "real time" basis. This involves updating search indexes, even sometimes pre-computing results, building different communication channels (e.g. for direct messages), and so on. They also might involve queue systems in case that the server cannot process all the incoming messages immediately.
Keep in mind that is not necessarily correct. Everything is still a loop eventually. Polling certainly is, open sockets are as well, just hidden from the development API.
One thing to keep in mind is that "real time" is a description of the result, not how it's done. MySQL can be "real time", and if you go far enough down, every poll, listener, and open socket is still a loop somewhere in C or machine code. All that matters in the end is that from the time information is requested to when it is acted upon, it's fast enough to seem instantaneous. Usually, less than 500 ms is a good benchmark. Most real time systems target less than 200 ms, and on a local machine only, less than 5 ms.
i read a description that said fast is desirable. BUT not always the case. However, PREDICTABILITY is more important for real-time architecture.
Ex : In a real-time architecture you process and analyze or serve data as close as possible to when you get a hold of it, sometimes in less than a second, or minutes later at most. While in theory any data-driven organization could benefit from zero or near-zero latency, it's not critical in every case
It's literally any architecture that can respond in real time. As I said above, depending on the task, probably anywhere from about 10-200 ms is a fairly safe bet.
3
u/isolatrum Feb 13 '23
A "real time" application (such as a chat room or multiplayer video game) needs to be built differently than a "normal" application.
In a "normal" application, you only get results when you take a specific action. E.g. on Reddit, you only receive an updated list of comments when you refresh the page. Compare this with a chat room or messenger app where changes show up on your page immediately as they happen.
In the older days, people would do this with loops. E.g. your website would have a loop running that would ask the server for updates every second or whatever.
These days, we use different protocols such as websockets which mean we don't have to do this loop (also called "polling").
A real time architecture may need to do other things so that the entire site works well on a "real time" basis. This involves updating search indexes, even sometimes pre-computing results, building different communication channels (e.g. for direct messages), and so on. They also might involve queue systems in case that the server cannot process all the incoming messages immediately.
1
u/FromBiotoDev Feb 13 '23
!remindme 1 day
-1
u/omniuni Developer Feb 13 '23
When a system is designed to give you a result so fast it feels like it's instantaneous, we consider that real-time.