Kai Chen
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # 虎年行大運 ~ Kafka - 開始的前因後果 ## 【前言】 延宕了好久,終於要進入到學習 Kafka 的時候了!! 先跟大家道歉,一個標題掛那麼久才要開始寫... (深深一鞠躬 ## 【單一系統到微服務架構】 對於 Back-End 程式設計師來說,MessageQueue 是一個必定會聽過的名詞,他就是俗稱的**訊息處理隊列**,或者我們可以更白話一點 -- **訊息處理中心** 有人可能會想,為什麼我們需要一個訊息處理中心呢? 對於系統架構發展有興趣的人可以先複習一下這篇 [虎年行大運 ~ SpringCloud - 負載平衡架構介紹](/MSPE1vCPTlaIP6Cm0DLxcQ) 世界正因為網際網路的發達進入了一個**資訊量爆炸**的時代,各位所接觸到的東西可能已經不需要花費長久的時間才能觸及,你可以在美國東岸獲取到西岸即時報導的新聞資訊;你可以在台灣從 Youtube 上瀏覽來自巴西上傳的影片。 在商業上,所面對的客戶已經從實體店面轉向了網路商城,到店的來客率也變成了商品被瀏覽數。營業策略的重點已經逐漸轉為數字化經營模式,為此你所需要的設備已經不是以往面對十幾人、百多人的小系統,而是必須扛住這數千、數萬不同訪問需求的大系統。 而若只是單純地將以往的系統架構給放大、再放大,則會失去面對未知的挑戰的彈性與變化的靈活度,永遠無法保證單一商業策略是否可以在現今的環境中生存,否則 Aamzon、Google 這種超大型企業為何要發展多角化經營? 回到系統架構來說,單純增添設備、買昂貴的 CPU、擴充硬碟、增加 RAM 並不能完全的解決資訊需求暴增的狀況,因此系統從單個大系統,逐漸轉變成小而精的多服務系統架構已是不可擋的趨勢,也就是目前常見的 -- **微服務架構** > 要強調視應用面的不同,工程師們應因地制宜採用適當的系統架構為主,上述說的是面對巨量訪問需求的商業服務狀況。 > > Kai 身邊仍有不少軟體公司打造的商品是採用單一系統架構,其客戶的商業服務不用面對高流量的問題,因此就不需要微服務架構了。 > > BTW,如何把錢花的每一分都值得,亦是系統分析師、架構師(SA、SD) 的一大考驗 ## 【訊息交換中心】 在微服務架構中,服務跟服務之間或多或少是需要交換訊息的,否則可能會發生漏資料、文不對題等錯誤發生。 例如:顧客在一個電商網站中下訂單,訂單的資訊需要給撿貨系統、倉儲系統、物流系統、甚至是財務系統知道,但每一個系統都還需要等待不同的系統處理好需要的資料才能繼續動作。 - 撿貨前需要倉儲告知商品庫存量 - 物流要等待撿貨完成 - 財務要等物流完成交付、金額入帳時啟動會計功能 面對一個又一個功能的 Pending,中間都需要有人去做通知處理,過往的做法可能是採用所謂的定時程式,類似分鐘結算、小時結算、一日結算、一周結算,甚至一月結算去處理,這在低流量的需求上沒太多問題,但在高流量的時候,速度就會慢了下來,且累積的量會越來越多! 因此就需要一個即時訊息交換的方式去不停的消化、吞吐這些流量資料,避免累積、同時讓這些事情可以統一在一個系統內自動完成,而不需要太多的程式或工法支援。 MessageQueue 就在這樣一個需求下,誕生了! 在其中的 Kafka,就是這篇與未來數篇章的主角~ 首頁 [Kai 個人技術 Hackmd](/2G-RoB0QTrKzkftH2uLueA) ###### tags: `Kafka`

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully