storing stateful WebSockets connection

Hey everyone, so, I am just learning that "stateful objects" can not be stored in a Database, like D1 or any other Database. KV won't work because it can only store string values. I'm learning that stateful connections in programming are stored in the memory of the running application.
3 Replies
NazCodeland
NazCodeland2mo ago
But, Durable Objects can store stateful information it seems. I am wondering why is it that Durable Objects are able to store stateful information given that it is not persisted in the memory of the running application
Hello, I’m Allie!
If you are talking about the WebSocket hibernation API, then it is not actually storing the WebSocket to its storage. It is just telling the runtime that, in the event of the Durable Object being evicted, it should keep the connection open If the runtime itself restarts, then you still lose the WebSocket connection
NazCodeland
NazCodeland2mo ago
was something else, sorry for the late reply but thanks for the support I figured out what I was confused about