How socket.io-redis adapter works? 레디스 어댑터 동작원리

보통 실시간 메시징 처리에 socket.io와 redis를 많이 사용하는데, 그 동작 메커니즘이 자세히 소개된 글을 찾기 어려웠다. 이유는 간단한데, 소스코드가 그냥 간단해서 글로 쓰고 자시고 건더기도 없어 그런듯. 

기본적으로 socket.io는 Server, Namespace, Room, 그리고 Socket으로 구성되어있고 멀티 노드를 위해 pluggable 디자인 방식으로 Adapter라는 것이 존재한다. 

Default In-Memory 방식은 배열에 socket과 room 정보를 저장하기 때문에 웹 서버에 붙어있는 clients 외 에는 알 길이 없다. 이때 redis adapter를 사용하면 다음과 같이 동작하는데, sender가 원격에서 넘어왔다면 그냥 내 로컬 clients에게 deliver하는 것으로 종료하고 그렇지 않으면, 다른 노드에게 publish하여 메시지를 전달한다. 


분산 인프라 치고는 놀랍게도 Javascript 몇 줄 안되는 소스코드로 node, socket.io, 그리고 redis가 동작한다. 좀 이해하기 쉽게 도식화하면 다음과 같다:


50 comments:

  1. Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I am looking forward to reading new articles. Keep up the good work!
    360DigiTMG

    ReplyDelete

  2. A good blog always comes-up with new and exciting information and while reading I have feel that this blog is really have all those quality that qualify a blog to be a one.
    iot course training in Hyderabad

    ReplyDelete
  3. I feel extremely glad to have seen your site page and anticipate such a large number of additionally engaging occasions perusing here. Much obliged again for all the subtleties.
    https://360digitmg.com/course/certification-program-in-iot

    ReplyDelete
  4. Your music is amazing. You have some very talented artists. I wish you the best of success.
    Best Data Science Courses in Hyderabad

    ReplyDelete
  5. It is a neat article without any clutter! The neatly organized content looks good. Can I quote a blog and write it on my blog? My blog has a diverse community, including these articles. Would you like to visit me later? 토토사이트

    ReplyDelete
  6. Your work is very good and I appreciate you and hopping for one of the finest sites on the internet. I will recommend this web site 토토사이트

    ReplyDelete
  7. Thanks for posting the best information and the blog is very informative.Data science course in Faridabad

    ReplyDelete
  8. You obviously know what youre talking about Guess I will just bookmark this site. 토토

    ReplyDelete
  9. my own blog and would like to find out where u got this from. Your post has really helped me a lot. 안전놀이터

    ReplyDelete
  10. Your writing is perfect and complete. 온라인바둑이 However, I think it will be more wonderful if your post includes additional topics that I am thinking of. I have a lot of posts on my site similar to your topic. Would you like to visit once?

    ReplyDelete
  11. Thank you for any other informative blog. Where else may just I am getting that kind of information written in such a perfect method? I have a mission that I’m simply now working on, and I have been on the glance out for such info. 먹튀검증

    ReplyDelete
  12. A good blog always comes-up with new and exciting information and while reading I have felt that this blog really has all those qualities that qualify a blog to be a one.

    Best Data Science courses in Hyderabad

    ReplyDelete
  13. if you are the registered employee or an authorized associate working for one of the largest nba중계

    ReplyDelete
  14. Thank you for any other informative blog. Where else may just I am getting that kind of information written in such a perfect method 카지노사이트

    ReplyDelete
  15. employee or an authorized associate working for one of the largest 먹튀검증

    ReplyDelete
  16. First of all, thank you for your post. Your posts are neatly organized with the information I want, so there are plenty of resources to reference. I bookmark this site and will find your posts frequently in the future. Thanks again ^^ 바둑이사이트

    ReplyDelete
  17. It's really nice and meaningful. it's a really cool blog.you have really helped lots of people who visit blogs and provide them useful information.
    digital marketing courses in hyderabad with placement

    ReplyDelete
  18. https://www.omgab.com 우리카지노사이트
    https://www.omgab.com/theking 더킹카지노
    https://www.omgab.com/sands 샌즈카지노
    https://www.omgab.com/first 퍼스트카지노
    https://www.omgab.com/yes 예스카지노
    https://www.omgab.com/super 슈퍼카지노
    https://www.omgab.com/gatsby 개츠비카지노
    https://www.omgab.com/33 33카지노
    https://www.omgab.com/world 월드카지노
    https://www.omgab.com/merit 메리트카지노

    ReplyDelete
  19. https://www.omgqq.com 우리카지노사이트
    https://www.omgqq.com/thekingcasino 더킹카지노
    https://www.omgqq.com/sandscasino 샌즈카지노
    https://www.omgqq.com/firstcasino 퍼스트카지노
    https://www.omgqq.com/yescasino 예스카지노
    https://www.omgqq.com/supercasino 슈퍼카지노
    https://www.omgqq.com/gatsbycasino 개츠비카지노
    https://www.omgqq.com/33casino 33카지노
    https://www.omgqq.com/worldcasino 월드카지노
    https://www.omgqq.com/merit 메리트카지노

    ReplyDelete
  20. https://www.bbdd66.com 우리카지노사이트
    https://www.bbdd66.com/theking 더킹카지노
    https://www.bbdd66.com/sands 샌즈카지노
    https://www.bbdd66.com/first 퍼스트카지노
    https://www.bbdd66.com/yes 예스카지노
    https://www.bbdd66.com/super 슈퍼카지노
    https://www.bbdd66.com/gatsby 개츠비카지노
    https://www.bbdd66.com/33 33카지노
    https://www.bbdd66.com/world 월드카지노
    https://www.bbdd66.com/merit 메리트카지노

    ReplyDelete
  21. https://www.omgka.com 우리카지노사이트
    https://www.omgka.com/theking 더킹카지노
    https://www.omgka.com/sands 샌즈카지노
    https://www.omgka.com/first 퍼스트카지노
    https://www.omgka.com/yes 예스카지노
    https://www.omgka.com/super 슈퍼카지노
    https://www.omgka.com/gatsby 개츠비카지노
    https://www.omgka.com/33 33카지노
    https://www.omgka.com/world 월드카지노
    https://www.omgka.com/merit 메리트카지노

    ReplyDelete
  22. https://www.oobbg.com 우리카지노사이트
    https://www.oobbg.com/theking 더킹카지노
    https://www.oobbg.com/sands 샌즈카지노
    https://www.oobbg.com/first 퍼스트카지노
    https://www.oobbg.com/yes 예스카지노
    https://www.oobbg.com/coin 코인카지노
    https://www.oobbg.com/33 33카지노
    https://www.oobbg.com/world 월드카지노
    https://www.oobbg.com/merit 메리트카지노
    https://www.oobbg.com/gatsby 개츠비카지노

    ReplyDelete
  23. As soon as I noticed this internet site I went on reddit to share some of the love with them. 먹튀

    ReplyDelete
  24. Thanks for posting the best information and the blog is very important.data science institutes in hyderabad

    ReplyDelete
  25. I got a web site from where I be capable of really obtain valuable information regarding my study and knowledge.
    Great Article… Good Job… Thanks For Sharing…

    Website:바카라


    ReplyDelete
  26. i am glad to discover this page : i have to thank you for the time i spent on this especially great reading !! i really liked each part and also bookmarked you for new information on your site.
    artificial intelligence training in chennai

    ReplyDelete
  27. Tremendous blog quite easy to grasp the subject since the content is very simple to understand. Obviously, this helps the participants to engage themselves in to the subject without much difficulty. Hope you further educate the readers in the same manner and keep sharing the content as always you do.

    data science course in faridabad

    ReplyDelete
  28. Amazing article..!! Thank you so much for this informative post. I found some interesting points and lots of information from your blog. Thanks 토토커뮤니티

    ReplyDelete
  29. I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article :D 안전놀이터순위

    ReplyDelete
  30. Stay up the good work! You know, many people are looking round for this info, you could aid them greatly. 토토

    ReplyDelete
  31. back every day. It’s great to have a place like this. I’ll come often. Great work! 경마사이트

    ReplyDelete
  32. Thanks on your marveous posting! dependably manufacture astonishing entities
    Please always write good comments 온라인카지노

    ReplyDelete
  33. I have been reading your blog posts for month and its been the greatest thing I am doing in past few months. keep up the good work for sharing the information. 토토

    ReplyDelete
  34. That's a really impressive new idea! 메이저토토사이트추천 It touched me a lot. I would love to hear your opinion on my site. Please come to the site I run once and leave a comment. Thank you.


    ReplyDelete
  35. Hello, I am one of the most impressed people in your article. 안전놀이터추천 I'm very curious about how you write such a good article. Are you an expert on this subject? I think so. Thank you again for allowing me to read these posts, and have a nice day today. Thank you.


    ReplyDelete
  36. Youre so right. Im there with you. Your weblog is definitely worth a read if anyone comes throughout it. Im lucky I did because now Ive received a whole new view of this. 메이저사이트추천


    ReplyDelete
  37. When I read your article on this topic, the first thought seems profound and difficult. There is also a bulletin board for discussion of articles and photos similar to this topic on my site, but I would like to visit once when I have time to discuss this topic. 안전토토사이트


    ReplyDelete
  38. Thanks for posting the best information and the blog is very good.data science course in Lucknow

    ReplyDelete
  39. You made some good points there. I did a Google search about the topic and found most people will believe your blog. 메이저사이트


    ReplyDelete
  40. That's a great article! The neatly organized content is good to see. Can I quote a blog and write it on my blog? My blog has a variety of communities including these articles. Would you like to visit me later? 토토사이트추천


    ReplyDelete
  41. What a post I've been looking for! I'm very happy to finally read this post. 안전놀이터 Thank you very much. Can I refer to your post on my website? Your post touched me a lot and helped me a lot. If you have any questions, please visit my site and read what kind of posts I am posting. I am sure it will be interesting.


    ReplyDelete
  42. What a nice post! I'm so happy to read this. 안전놀이터모음 What you wrote was very helpful to me. Thank you. Actually, I run a site similar to you. If you have time, could you visit my site? Please leave your comments after reading what I wrote. If you do so, I will actively reflect your opinion. I think it will be a great help to run my site. Have a good day.


    ReplyDelete
  43. You made some good points there. I did a Google search about the topic and found most people will believe your blog. 메이저사이트


    ReplyDelete