But in an ominous result for Democrats, two swing states — Iowa and Ohio — appeared to move decisively away from them, and Florida, the country’s largest swing state and another state Mr. Trump won in 2016, remained agonizingly elusive. Should those three states tilt toward Mr. Trump in 2020, it would leave Democrats squeezed across the rest of the map.

“To win the upper Midwest and Florida we have to do two things Obama was able to do: get exceptionally strong African-American turnout and also get a higher proportion of noncollege whites,” said Robby Mook, who ran Mrs. Clinton’s campaign, adding that Mr. Obama’s success was a reminder that there doesn’t have to be an either-or solution to the party’s goal of defeating Mr. Trump.

“Barack Obama was not an old white guy but he checked these boxes,” Mr. Mook said.

Because of the mélange of results Tuesday, there was little to deter ambitious Democrats from moving ahead with preparations for 2020, most of them eyeing early announcements to avoid letting any competitors catch fire.

Ms. Harris, the senator from California, is seen by allies as likely to announce a campaign early in next year, after the release of a book due out in January. Her sister, Maya Harris, a former top adviser to Mrs. Clinton, has already been quietly gauging the intentions of some influential Democrats in order to have an early roster of supporters ready.

The Harris camp has also been reaching out to potential campaign staff members who could manage fund-raising operations and a strategy for amassing convention delegates over a long primary while the senator herself has been courting Democrats in the states that begin the nominating process, such as Mr. Vilsack and former Gov. James Hodge of South Carolina.

Allies of Mr. Booker, the senator from New Jersey, spent this week highlighting his efforts to help candidates in states crucial to the presidential nominating process, while he began considering staffing decisions.

Multiple Democrats said that Addisu Demissie, who just ran the campaign of Gavin Newsom, the governor-elect of California, could potentially serve as a top official in either Mr. Booker’s campaign or a super PAC that allies of the senator may launch.