The second variant stores the elements of the broadcasted stream in operator (thus non-keyed) state.
On the differences:
The Broadcast stream is not a keyed stream, so you are not in a keyed context, thus you have no access to keyed state.
Given this, and assuming that you are implementing a CoProcessFunction, then your function should also implement the
ListCheckpointed interface and store the broadcasted data as ListState.
From a systems perspective, in case of rescaling, then your function should take care of removing duplicated manually
as in the case of scaling down for example, the state of 2 nodes may end up on one. In addition, given that elements are
re-distributed randomly, you may even end up with some elements missing one some nodes. This would be more evident
in case of scaling up. In this case, nodes will be missing data.
From an API perspective, assuming that the other stream is keyed and it has state, accessing it in order to do some computation
would be impossible.