p-society / gc-server

Stay updated in real-time and engage with the thrill of the game like never before.[WIP]
Apache License 2.0
3 stars 6 forks source link

[DISCUSSION]: Server Side Events or Websockets? #45

Open zakhaev26 opened 7 months ago

zakhaev26 commented 7 months ago

In light of recent discussions and insights, I'm reconsidering our decision to utilize SSE over Websockets for emitting scores to clients.

During a conversation with a senior colleague, they shared their experience building a product (Hubilo Studio) using Websockets, WebRTC,and a LOT more things, - capable of scaling and handling up to 1L~ concurrent users. This has prompted me to reassess our choice.

He emphasized that Websockets currently offer the most robust solution, particularly considering the ecosystem and industry trends. He highlighted that many companies are shifting towards Websockets for real-time communication due to the comprehensive support and scalability options available and OSS tools around it

Our initial concern (as we , @majorbruteforce and @me discussed ) was scalability for the GC server if we choosed ws. If viable solutions exist for Websockets, it seems prudent to explore them further. The broader support and resources available for it compared to SSE may offer advantages in terms of implementation and future maintenance.

I propose revisiting our technology stack decision and considering the potential benefits of adopting Websockets for our real-time communication needs,as most of the work in the core sections (majorly the crud apis,are completed). Stuffs like auto-healing, handling backpressure, message sharing between distributed servers using redis, connection retry mechanisms, and ack/nack support might align better with our requirements and facilitate smoother integration and maintenance.

Feedback and opinions on this matter are welcome for further discussion. CC: @majorbruteforce @punitkr03 @soumil-kumar17

punitkr03 commented 7 months ago

@zakhaev26 Bro literally tagging me everywhere ☠️

punitkr03 commented 7 months ago

@zakhaev26 SSE +1 Websockets are too resource intensive. Btw, open to discussions.

zakhaev26 commented 7 months ago

@zakhaev26 Bro literally tagging me everywhere ☠️

GitHub is not for beginners

kraytos17 commented 7 months ago

Websockets are more resource intensive than sse, but until we recklessly open multiple connections, we should not face many issues regarding resource consumption. This may probably help.

zakhaev26 commented 7 months ago

Found a 🔥 article on websockets impl in go Link to article :https://programmingpercy.tech/blog/mastering-websockets-with-go/ CC: @majorbruteforce @soumil-kumar17

majorbruteforce commented 7 months ago

Good find Mr. White

zakhaev26 commented 6 months ago

Made a POC using kafka ,ws referring to the article. stuff works good check : https://github.com/zakhaev26/distributed-ws-kafka will be adding traefik stuff soon