-
Notifications
You must be signed in to change notification settings - Fork 17
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
[Abstraction] Decide how to handle key deserialization when key schema might vary #86
Comments
Is the idea that the key field is just used to partition things within a given topic? |
I think that's right? And for log compaction, I guess. |
sorry for a bit of a driveby but I can't stop thinking about this one using the cert event there is one model change: new certificate for Andy in Cheating 101 it feels definitely wrong for the event to sometimes by keyed under Andy and sometimes under Cheating101 it feels suboptimal but understandable for us to start out by keying it under Andy but decide later that these should all come out keyed under Cheating101 having it keyed by (Andy, Cheating101) implies that a watcher has some syntax to filter for (*, Cheating101). But that makes me think that actually what watcher would even want to get only some cert events? Or do they have a list of courses they are watching? Or... what? This feels like the tip of a pretty weird iceberg. I think I'm coming down for the last option. And maybe not calling this "key" when it's actually "debug/log helper label". Then we could just make sure to log "Andy/Cheating101" |
For cert events, I think we might just want to go with a constant/empty key -- no partitioning, no log compaction, just "these are things that are happening". If we want log compaction ("only keep the latest information for certificate 123") we start including a an explicit ID field for certificates. I assume some kind of ID like that exists in the DB; we would just need to start including it. |
@ashultz0: I think that the partitioning use case is less about filtering and more about load distribution and ordering guarantees. For example:
@timmc-edx: Some random thoughts:
|
For now, I'm listing this ticket as part of "Abstraction" work, in case there are any changes we want to the API before other technologies are implemented. |
In the current event bus code, it is possible for signals to be broadcast as events using varying key IDs on the same topic. For example, the CERTIFICATE_CREATED signal could be emitted as events with a key taken from
certificate.user.id
, or a key taken fromcertificate.course.course_key
. This presents a problem for deserialization: One of those is a number, and the other is a string; deserialization of the key will fail if the key schema is not knowable from the event.I can see several possible solutions:
"key_field": "certificate.user.id"
) so that the consumer can tell how to deserialize the key.The text was updated successfully, but these errors were encountered: