Skip to content

Commit

Permalink
Fixed graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcosBarrilVillaverde committed May 2, 2024
1 parent 9ae6780 commit 897b853
Showing 1 changed file with 46 additions and 24 deletions.
70 changes: 46 additions & 24 deletions docs/src/06_runtime_view.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,29 @@ autonumber
actor "User" as user
user -> "Game Service": Begins game
user -> "Webapp": [clicks] Starts New Game
"Webapp" -> "Game Service": Requests new game
"Game Service" -> "Game Service" : Creates new game
"Game Service" -> "Question Generator Service" : Requests n questions
database "MongoDB database" as DB
"Question Generator Service" -> DB : Requests information to create questions
DB -> "Question Generator Service" : Returns information
"Question Service" -> "Question Service" : Creates questions
"Question Service" -> "Game Service" : Returns questions
DB --> "Question Generator Service" : Returns information
"Question Generator Service" -> "Question Generator Service" : Creates questions
"Question Generator Service" -> "Question Historic Service" : Sends the generated questions
"Question Generator Service" --> "Game Service" : Returns questions
loop n times
"Game Service" -> user : Shows question
"Game Service" --> "Webapp" : Returns question
"Webapp" -> user : Shows question
user -> "Game Service" : Responds question
user -> "Webapp" : Responds question
"Webapp" -> "Game Service" : Responds question
end
"Game Service" -> "Question Historic Service" : Sends the shown questions
"Game Service" -> "Player Stats Service" : Sends the user's match data
"Game Service" -> "User Stats Service" : Sends the user's match data
----

In circumstances in which few questions are needed for the game, it may be possible to extract all of them in a batch without affecting performance and response times. Besides, extracting them this way opens up the possibility of using multiple threads to gather the data, greatly increasing performance. However, if the querying times are too high, this strategy may cause great delays while loading the game. A possible alternative is explained below:
Expand All @@ -41,39 +46,50 @@ autonumber
actor "User" as user
user -> "Game Service": Begins game
user -> "Webapp": [clicks] Starts New Game
"Webapp" -> "Game Service": Requests new game
"Game Service" -> "Game Service" : Creates new game
"Game Service" -> "Question Generator Service" : Requests n questions
database "MongoDB Database" as db
"Question Generator Service" -> db : Requests information to create questions
db -> "Question Generator Service" : Returns information
"Question Generator Service" -> "Game Service" : Returns questions
db --> "Question Generator Service" : Returns information
"Question Generator Service" -> "Question Historic Service" : Sends the shown questions
"Question Generator Service" --> "Game Service" : Returns questions
loop Until the game ends
loop n-k times
"Game Service" -> user : Shows question
...
user -> "Game Service" : Responds question
"Game Service" --> "Webapp" : Returns question
"Webapp" -> user : Shows question
user -> "Webapp" : Responds question
"Webapp" -> "Game Service" : Responds question
end
"Game Service" -> "Question Generator Service" : Requests n questions
"Question Generator Service" -> db : Requests information to create questions
db -> "Question Generator Service" : Returns information
db --> "Question Generator Service" : Returns information
"Question Generator Service" -> "Question Historic Service" : Sends the shown questions
"Question Generator Service" -> "Question Generator Service" : Creates questions
"Question Generator Service" -> "Game Service" : Returns questions
"Question Generator Service" --> "Game Service" : Returns questions
loop k times
"Game Service" -> user : Shows question
...
user -> "Game Service" : Responds question
"Game Service" --> "Webapp" : Returns question
"Webapp" -> user : Shows question
user -> "Webapp" : Responds question
"Webapp" -> "Game Service" : Responds question
end
end
"Game Service" -> "Question Historic Service" : Sends the shown questions
"Game Service" -> "Player Stats Service" : Sends the user's match data
"Game Service" -> "User Stats Service" : Sends the user's match data
----

In cases where a lot of questions are needed, or wikidata querying has a great impact on performance, this alternative may prove to be convenient. By distributing the data fetching along the entire match, bottlenecks on performance will be reduced. Depending on the system load, or even on client device's specifications, batch sizes may vary adapting to maintain responsiveness.
Expand Down Expand Up @@ -103,11 +119,17 @@ autonumber
actor "User" as user
user -> "Store Question Service" : Requests user data
user -> "WebApp" : Requests questions data
"WebApp" -> "Api's Gateway Service" : Requests questions data
"Api's Gateway Service" -> "Store Question Service" : Requests questions data
database "MongoDB Database" as db
"Store Question Service" -> db : Makes petition through REST API
db -> "Store Question Service" : Returns information
"Store Question Service" -> user : Shows data
db --> "Store Question Service" : Returns Data
"Api's Gateway Service" <-- "Store Question Service" : Returns Data
"WebApp" <-- "Api's Gateway Service" : Returns Data
"WebApp" -> user : Shows data
----

0 comments on commit 897b853

Please sign in to comment.