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

Consider just using unique IDs instead of UUIDs #50

Closed
aickin opened this issue Sep 12, 2018 · 5 comments
Closed

Consider just using unique IDs instead of UUIDs #50

aickin opened this issue Sep 12, 2018 · 5 comments

Comments

@aickin
Copy link
Contributor

aickin commented Sep 12, 2018

From an implementer's perspective, I'd argue that requiring that vehicles, devices, and trips all have UUIDs could be a bit of pain, and I'm not totally sure why it's required. Since a provider is presumably in charge of all their fleet data, they would have the ability to allocate unique IDs without using UUID. What do you think about just changing this to String type and requiring that it be unique by provider?

@asadowns
Copy link
Contributor

I don't believe the spec specifies that vehicle_ids must be UUIDs since these must be displayed on the vehicle. For the others I think UUID seems like the right approach. Two cents.

@aickin
Copy link
Contributor Author

aickin commented Sep 12, 2018

@asadowns Thanks for the response! As I read it, there is a UUID to identify vehicles in the agency API, but it's called unique_id. For example, it's a parameter in register_vehicle.

@asadowns
Copy link
Contributor

Ahh. good point. I guess it's clarified a bit on the provider side where they specify what the device_id is. I interpreted that this unique_id and the device_idbeing synonymous but it probably should be spelled out more clearly you're right.

MDS defines the device as the unit that transmits GPS signals for a particular vehicle. A given device must have a UUID (device_id below) that is unique within the Provider's fleet.

Additionally, device_id must remain constant for the device's lifetime of service, regardless of the vehicle components that house the device.

@thekaveman
Copy link
Collaborator

thekaveman commented Sep 14, 2018

@asadowns your interpretation of the provider side matches mine. Probably some of the wording/field updates didn't make it over to the agency side, but I think the idea is to be as consistent as possible on both.

vehicle_id is whatever the provider uses on the vehicle itself to identify that vehicle from others. It should be visible to a human looking at the vehicle on the street (identifier meant for humans).

device_id is a UUID assigned to the GPS unit attached to the vehicle. According to #37 this is supposed to remain constant for the lifetime of the GPS unit (regardless of maintenance/re-attachment to other vehicles, etc.) to track it over time in the data (identifier meant for machines).

More context into the decision to use both can be had in #32; vin was subsequently renamed to the current vehicle_id for consistency of field name format. Some recent discussion on #51 calls some of these assumptions about device_id into question.

As for whether UUID or string is best for these identifiers meant for machines, I think that is still up for debate.

@hunterowens
Copy link
Collaborator

We very quickly noticed performance problems in our data warehouse when we introduced having to index on solely a string (vehicle_id + provider_id).

Having a UUID allows us to efficiently aggregate data from across many providers, this stack overflow post was helpful for me in understanding why we should get UUID. Which is that we are generating a distributed index across providers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants