Open conorgil opened 3 years ago
So I think there are two aspects here that are important:
I'm only going to address (1) because I think we that (2) should be encapsulated in (1).
Proposal for the DB so whoever writes the DB:
# pseudo go code coming up
# Voter Object
struct Voter {
id String
name String
address String
}
# Retrieving random voters
# Returns an array of Voter objects
voters := voterDb.chooseRandomVoters()
# Get a single voter
voter := voters[0]
# Commit this list of voters so they're not chosen again
voter.confirmPostcardSentToVoter(voter)
Generally, in terms of how we store this. I think the easiest thing to do is simply process all the data and throw it into DynamoDB in some pre-sorted order. So we just scan from the beginning of the db and then move data between tables. However the interface above should make it flexible enough that we could use a more random selection set and change the underlying implementation. There's a small likelihood of double sending to some person. Though, we will combat that by ensuring only a single process of this worker is running at a given time. For now hacky but keeping user data safe is the quickest way to the end (our own costs are our own burden).
We purchased and downloaded the information for registered voters in Philadelphia. The data is uploaded to our google drive here (I gave you both access).
The download came with a doc that explains the file format, column headers, etc.
Acceptance Criteria:
I can imagine a few heuristics for who we should send postcards to, so I think our DB should include more than the name and mailing address of each voter. Few ideas: