Replies: 1 comment 1 reply
-
Great questions. Currently, |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
tl:dr
How to actually make devices from the real world make an appearance in
mds-core
Background
In an ideal world (ideal from an agency's perspective), MSPs would consume the agency api and push status changes to the agency, which triggers subsequent processes, such as compliance evaluation.
As per our experience, the real world is far from ideal:
Not all providers are willing to consume
/agency
, let alone in a resilient way. Therefore, polling data is necessary.But (at least here in Germany), it's worse: not all providers offer an
/events
(or/status_changes
) endpoint, but only expose snapshots of the current state via/vehicles
or – worst case - GBFS. Edit: Forget about GBFS as worst case, there are providers only exposing custom formats 🤦Challenges
Harmonized persistence and processing
Given the diversity of provided information, we need to transform data in such a way that its heritage is transparent to subsequent processes. There are basically two general options (which come to my mind)
We chose the location centric approach, since it's comparatively easy to handle when processing snapshots (which is what we've done most of the times) and simple to visualize. But it has a lot of downsides, particularly precision, but is also tricky wrt concurrency. With more and more providers exposing status changes, precision is getting better, but processing this transformed data (e. g. when determining compliance) is not ideal.
I can see the ingest-service being responsible for processing devices and that you went for fully processing events. While I appreciate this, I wonder whether I was missing out a piece on your code which transforms snapshots of locations into events which it feeds into the ingest-service.
Also, I have not seen a transformation of the events chain into s snapshot of locations in order to e. g. visualize a state on the UI. Or is this transformation a responsibility of the consumer?
Polling
Nobody likes polling. But at least we have to. There are various ways to do this, be it a simple deployment with a custom scheduler, Kubernetes Cron jobs or cloud infrastructure (e. g. Lambda, CloudWatch rules).
Is there a solution in/around
mds-core
which cares about this aspect?If not: What are your experiences for good practices?
This might be a longer discussion (and in fact I am a bit hesitant to start this discussion as the first one here), but no doubt it's core to a challenge all agencies face, or isn't it?
Looking forward to reading from you,
Oliver
Beta Was this translation helpful? Give feedback.
All reactions