Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Schema for the service("people") controlling the State #1

Open
tanneberger opened this issue Apr 7, 2023 · 11 comments
Open

API Schema for the service("people") controlling the State #1

tanneberger opened this issue Apr 7, 2023 · 11 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@tanneberger
Copy link
Member

tanneberger commented Apr 7, 2023

Proposed API Schema

=> also working with waypoint

  • GET /vehicles/{region}
   {
      "last_update": "timestamp",
      "vehicles": [
         { ... waypoint ... for every vehicle one }
      ]
   }

or more structured

   {
    "last_update": "timestamp",
      "vehicles": {
        "4": {
          "20": { last waypoint },
          "33" : { last waypoint }
        },
        "61": {
           "2": { last waypoint },
           "3": { last waypoint }
        }
      }
   } 

Ideas of other features

  • Detailed Vehicle Information (would require saving data in memory for some time)
    • History of Delays
    • Path Took
  • Region Detailed Information
    • Average of Delays
    • Count of Vehicles that currently drive around (grouped by line)
@tanneberger tanneberger added enhancement New feature or request good first issue Good for newcomers labels Apr 7, 2023
@tanneberger tanneberger changed the title API Schema for the service(people) controlling the State API Schema for the service("people") controlling the State Apr 7, 2023
@MarcelCoding
Copy link
Member

I think the first version is better? Because I would convert the second one into the first one otherwise.

@gshipunov
Copy link
Member

I'm not sure if we want to carry extra data around in the same response. Per @MarcelCoding just a list of waypoints is easier for frontend, so I would just go with it. For anything else, if we need it, I would just move it to separate endpoint (since merging this into just a list of waypoints will be a pain).

@MarcelCoding
Copy link
Member

You mean don't send the coordinates directly? How should interpolation then be done?

@gshipunov
Copy link
Member

Nope, I only mean "extra features" mentioned above

@MarcelCoding
Copy link
Member

MarcelCoding commented Apr 8, 2023

Ohh, I can't read, sorry xs idk a snapshot of the last data that is send over the websocket would be nice.

@tanneberger
Copy link
Member Author

@MarcelCoding U mean that we also would send the interpolated data over the websocket ? And the frontend would be reduced to pure display minimal logic ?

@MarcelCoding
Copy link
Member

Idk, at least that is how it is done currently. There would alps be other options. Idk, I think it does not realy matter how it is done.

@tanneberger
Copy link
Member Author

Yeah thats a different discussion I would say

@tanneberger
Copy link
Member Author

So I started building variant number 1. With the extra caveat that I will save in memory a history of time X.

@gshipunov
Copy link
Member

@revol-xut maybe worth looking at memcached?

@tanneberger
Copy link
Member Author

tanneberger commented Apr 8, 2023

@oxapentane maybe worth for scalability but my worst case calculation would result of holding approx a 1GB in Memory Assuming we get approx 16 Waypoints per Second (currently we get like 2)

But guess good point because assuming we have 20 Drivers using the app we will have waaaaaaayyyyy more data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants