Skip to content

Instantly share code, notes, and snippets.

@Rasukarusan
Created August 25, 2019 06:34
Show Gist options
  • Save Rasukarusan/54c49b652c48e9f6d093e15532836a80 to your computer and use it in GitHub Desktop.
Save Rasukarusan/54c49b652c48e9f6d093e15532836a80 to your computer and use it in GitHub Desktop.
@startuml
title 家計簿アプリの家計簿取得シーケンス

participant "ユーザー"

box "家計簿システム" #LightBlue
    participant "Play"
    participant "Redis"
    participant "MySQL"
end box

"ユーザー" -> "Play" : 家計簿を取得
"Play" -> "Redis" : ユーザーID、今月という時間をキーに取得
    alt キャッシュヒット
        "Play" <-- "Redis" : 家計簿情報または家計簿がないという情報
    else キャッシュミス
        "Play" <-- "Redis" : キャッシュされていないという情報
        "Play" -> "MySQL" : 家計簿取得
        "Play" <-- "MySQL"
        alt 家計簿情報あり
            "Play" ->> "Redis" : 非同期に\n家計簿情報を格納
        else 家計簿情報なし
            "Play" ->> "Redis" : 非同期に\n家計簿がないという情報を格納
        end
    end
"ユーザー" <-- "Play" : 家計簿情報または家計簿がないという情報
@enduml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment