[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"academy-blogs-en-1-1-all-graphql-websocket-go-chat-system-all--*":3,"academy-blog-translations-3tx55c66fzcypax":109},{"data":4,"page":97,"perPage":97,"totalItems":97,"totalPages":97},[5],{"alt":6,"collectionId":7,"collectionName":8,"content":9,"cover_image":10,"cover_image_path":11,"created":12,"created_by":13,"expand":14,"id":103,"keywords":104,"locale":79,"published_at":105,"scheduled_at":13,"school_blog":101,"short_description":106,"slug":107,"status":99,"title":6,"updated":108,"updated_by":13,"views":102},"EP.34 Building a Real-Time Chat System with GraphQL and WebSocket in Go","sclblg987654321","school_blog_translations","\u003Ch2>Why Use GraphQL and WebSocket for Real-Time Chat?\u003C\u002Fh2>\u003Cp>In the era of real-time applications, chat systems are one of the essential features that must support instant message delivery. GraphQL Subscriptions and WebSocket enable clients to track data changes and receive new messages immediately without repeatedly calling the API.\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>Chat System Architecture\u003C\u002Fh3>\u003Col>\u003Cli>GraphQL Server - Handles Queries, Mutations, and Subscriptions\u003C\u002Fli>\u003Cli>WebSocket Gateway - Manages real-time message delivery\u003C\u002Fli>\u003Cli>Database (PostgreSQL\u002FRedis) - Stores chat history and user status\u003C\u002Fli>\u003C\u002Fol>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>Creating GraphQL Schema for Chat System\u003C\u002Fh3>\u003Cp>File: schema.graphql\u003C\u002Fp>\u003Cpre>\u003Ccode class=\"language-plaintext\">type Query {\n  messages: [Message!]!\n}\n\ntype Mutation {\n  sendMessage(content: String!, sender: String!): Message!\n}\n\ntype Subscription {\n  messageReceived: Message!\n}\n\ntype Message {\n  id: ID!\n  content: String!\n  sender: String!\n  timestamp: String!\n}\u003C\u002Fcode>\u003C\u002Fpre>\u003Ch4>Challenge!\u003C\u002Fh4>\u003Cp>Try expanding the chat system to support Chat Rooms and user notifications by using WebSocket and Redis Pub\u002FSub. This will allow messages to be distributed across multiple servers effectively.\u003C\u002Fp>\u003Chr>\u003Ch4>Next Episode\u003C\u002Fh4>\u003Cp>In EP.35, we will discuss improving the performance of the chat system by using Redis and Load Balancing to support a large number of users! Stay tuned for more coming soon! 🚀\u003C\u002Fp>","40_11zon_3qf0ww6cok.webp","https:\u002F\u002Ftwsme-r2.tumwebsme.com\u002Fsclblg987654321\u002Fk6y1oirmesd5h0r\u002F40_11zon_3qf0ww6cok.webp","2026-03-04 08:51:20.314Z","",{"keywords":15,"locale":73,"school_blog":83},[16,23,28,33,38,43,48,53,58,63,68],{"collectionId":17,"collectionName":18,"created":19,"created_by":13,"id":20,"name":21,"updated":22,"updated_by":13},"sclkey987654321","school_keywords","2026-03-04 08:51:19.396Z","u64yt1w9x0lqknb","System Scalability","2026-04-10 16:14:35.375Z",{"collectionId":17,"collectionName":18,"created":24,"created_by":13,"id":25,"name":26,"updated":27,"updated_by":13},"2026-03-04 08:44:29.876Z","ozn15duk6wovj6g","Microservices","2026-04-10 16:12:46.024Z",{"collectionId":17,"collectionName":18,"created":29,"created_by":13,"id":30,"name":31,"updated":32,"updated_by":13},"2026-03-04 08:51:19.902Z","ybwrb9ksy12o89r","API Development","2026-04-10 16:14:35.541Z",{"collectionId":17,"collectionName":18,"created":34,"created_by":13,"id":35,"name":36,"updated":37,"updated_by":13},"2026-03-04 08:51:19.718Z","jqvc882wc9kcby8","Chat Application","2026-04-10 16:14:35.447Z",{"collectionId":17,"collectionName":18,"created":39,"created_by":13,"id":40,"name":41,"updated":42,"updated_by":13},"2026-03-04 08:46:14.782Z","v0mhensk18fofru","WebSocket Chat","2026-04-10 16:13:10.563Z",{"collectionId":17,"collectionName":18,"created":44,"created_by":13,"id":45,"name":46,"updated":47,"updated_by":13},"2026-03-04 08:47:05.949Z","caufix9o52uw4bh","Real-Time Chat","2026-04-10 16:13:23.517Z",{"collectionId":17,"collectionName":18,"created":49,"created_by":13,"id":50,"name":51,"updated":52,"updated_by":13},"2026-03-04 08:46:53.342Z","5ac1xgod1ehyqva","GraphQL Subscriptions","2026-04-10 16:13:20.256Z",{"collectionId":17,"collectionName":18,"created":54,"created_by":13,"id":55,"name":56,"updated":57,"updated_by":13},"2026-03-04 08:20:14.253Z","ah6lvy4x8qe08l5","Golang","2026-04-10 16:07:26.172Z",{"collectionId":17,"collectionName":18,"created":59,"created_by":13,"id":60,"name":61,"updated":62,"updated_by":13},"2026-03-04 08:20:11.547Z","ey3puyme01a9bsw","Go","2026-04-10 16:07:25.893Z",{"collectionId":17,"collectionName":18,"created":64,"created_by":13,"id":65,"name":66,"updated":67,"updated_by":13},"2026-03-04 08:34:00.920Z","ecac9y661or1xka","WebSocket","2026-04-10 16:08:05.227Z",{"collectionId":17,"collectionName":18,"created":69,"created_by":13,"id":70,"name":71,"updated":72,"updated_by":13},"2026-03-04 08:51:14.205Z","laiwsvubam25wcf","GraphQL","2026-04-10 16:14:34.380Z",{"code":74,"collectionId":75,"collectionName":76,"created":77,"flag":78,"id":79,"is_default":80,"label":81,"updated":82},"en","pbc_1989393366","locales","2026-01-22 11:00:02.726Z","twemoji:flag-united-states","qv9c1llfov2d88z",false,"English","2026-04-10 15:42:46.825Z",{"category":84,"collectionId":85,"collectionName":86,"expand":87,"id":101,"views":102},"wqxt7ag2gn7xcmk","pbc_2105096300","school_blogs",{"category":88},{"blogIds":89,"collectionId":90,"collectionName":91,"created":92,"created_by":13,"id":84,"image":93,"image_alt":13,"image_path":94,"label":95,"name":96,"priority":97,"publish_at":98,"scheduled_at":13,"status":99,"updated":100,"updated_by":13},[],"sclcatblg987654321","school_category_blogs","2026-03-04 08:33:53.210Z","59ty92ns80w_15oc1implw.png","https:\u002F\u002Ftwsme-r2.tumwebsme.com\u002Fsclcatblg987654321\u002Fwqxt7ag2gn7xcmk\u002F59ty92ns80w_15oc1implw.png",{"en":96,"th":96},"Golang The Series",1,"2026-03-16 04:39:38.440Z","published","2026-04-25 02:32:15.470Z","3tx55c66fzcypax",213,"k6y1oirmesd5h0r",[20,25,30,35,40,45,50,55,60,65,70],"2025-03-13 02:23:46.631Z","Learn how to use GraphQL Subscriptions and WebSocket to create a real-time chat system in Go that supports instant message delivery and is designed to scale efficiently.","graphql-websocket-go-chat-system","2026-04-22 07:11:46.348Z",{"en":107}]