GraphQL 在酒店系統上的實踐

{"type":"doc","content":[{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"1 問題由來"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"關於我們 Node 服務產生了什麼問題,爲什麼會出現這些問題,以及爲何需要採用 GraphQL 去解決這些問題,是一個值得探究的過程。下面,我將從服務架構入手,簡單介紹一下項目背景,而後通過幾個案例,讓大家更形象的理解我們現在的問題是如何產生的。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":"1.1 服務架構簡介"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.infoq.cn\/resource\/image\/b0\/24\/b0731507d4c6d982d138105c53ba6024.png","alt":null,"title":null,"style":null,"href":null,"fromPaste":true,"pastePass":false}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"左邊方框內屬於我們前端團隊的服務,右邊屬於後端服務。這裏只是比較粗糙的架構,省略了一些負載均衡等細節,對於我司國內酒店服務來說,這裏的圖示就足以解釋說明我們的問題。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"而我們 Node 組,是處於承接上下游的一個位置,是屬於直接服務於前端的後端,也就是所謂的 BFF 層,關於這個架構的形成過程,我後面會展開解釋。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"就目前而言,我們的主要職責是多端適配,UI 適配,版本控制,下發一些AB實驗,日誌收集等。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"雖然我上面說了許多職能,但是我認爲我們最核心的職能,其實就是負責給客戶端同學輸送數據,那麼我們輸送數據的過程中會產生什麼問題?爲什麼會產生這些問題,下面讓我來舉例說明一下。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":"1.2 案例一:數據定製困難"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}}]}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章