1. This is an explanation of a microservice developed for interacting(like share, regossip, bookmark) with the gossip.
  2. We have adopted the separation of concerns pattern in our program, wherein, we have the route handlers, which belong to the web layer, and then we have the business logic layer, which contains our services, and then, at last, we have the DAL layer which is the only part of program allowed to communicate with the database and Redis.
  3. In this microservice, we are using the socket connection to communicate.
  4. when the user logs into his gossip chimp account, he will be redirected to the main web page of our web app which will provide the gossips.
  5. that web page will be served by the gossip feed microservice, and that web page will create two socket connections one with the gossipFeed microservice for requesting gossips and another socket connection with our gossip Interaction microservice to interact with gossip (like comment, share,regossip, bookmark, etc..,)
  6. since we are establishing two socket connections, there are quite a few challenges as well and some of those are - complexity is increased, maintaining two socket connections at all times is an overhead both on the server and the client end, security, etc..,
  7. In this GossipInteraction microservice, when the user interacts with a gossip, a request to execute some interaction operation will be sent to one of our GossipInteraction microservice through a socket connection.
  8. now based on that request, the route handler will communicate with our services to successfully complete that operation.
  9. Here we have different services for commenting, sharing, regossiping, reporting, bookmarking, liking gossips & retrieving user details & retrieving gossip details & retrieving user following list and followers list & service for following or unfollowing users, etc..,
  10. these services will communicate with our DAL layer which is the only part of the program which has the authority to communicate with MongoDB Database and Redis cache.
  11. This DAL layer will update the gossip and user info in the database and cache based on the operation performed.