Who cares how someone voted at that point. Voting just becomes an exercise in futility.
Join that with Drivers license -> Voter registration number.
Search the voter records (if the states still have them) with the issued ballot number to that voter registration number and bingo. You got voting records.
Think most states discard actual ballots over time though so maybe old data might be gone. Republican states garbage as they are probably stored this election for some reason. I bet you can guess what that reason is.
I believe this involves a court order and to physically access the ballots in most states, where the ballots haven't been destroyed.
I would be very surprised if such a database existed in most states and if it was easy for someone from the federal government to make a query without many hoops and ladders.
Blue states will probably resist, trump will probably threaten loss of federal funding(if he hasn't already taken it away by then) and the states will either comply or resist by doing things like rapidly destroying records.
Are you suggesting that how I voted is stored somewhere by my Social Security Number?
In some states maybe you can do primaries without registering.
To be clear, you can’t find out how someone voted this way. You can only find out if they submitted a ballot, not what the ballot said.
The issue is that these are likely different databases and would require active participation by the states. Blue states will probably find a way to resist. (Maybe destroy the voting records quicker?) Although they can probably still find party registration.
Best I can find is this infographic which seems to indicate your point so i'll concede that you are likely correct: https://www.essvote.com/storage/2018/11/How_It_Works_Ovals_a...