Alcaraz and Medvedev sail through to third round at Shanghai Masters
Italy's Jannik Sinner is also through after battling out an intense first set - saving four set points - against the United States' Marcos Giron.
Alcaraz dominated his first set against 73rd-ranked Gregoire Barrere, winning it 6-2.
But the Frenchman regained ground in the second, sending 20-year-old Alcaraz scurrying from side to side of the court.
The world number two kept his cool and drew ahead towards the set's end, finishing it off at 7-5.
"I just had one practice and then the match, you know, it's kind of new for me," Alcaraz said of his Shanghai debut.
"But I felt really well on this court here in Shanghai, I've been playing great tennis."
Alcaraz is looking to close the gap on the absent Novak Djokovic at the top of the rankings with strong performances in China.
Medvedev, the world number three and defending champion, beat Chile's Cristian Garin in straight sets 6-3, 6-3 to proceed breezily to the third round.
Garin put up a valiant defence, with several hard-fought rallies inducing gasps from the crowd, but ultimately the 98th-ranked player struggled with the Russian's relentless pace.
"(There's a) long tournament ahead, with a lot of strong players, starting from my next match," said Medvedev at the end.
"But the goal for sure is to try and win this beautiful trophy one more time."
Lucky butterfly
Medvedev won the 2019 title, but for the next three years the tournament was cancelled because of the Covid-19 pandemic.
"I'm definitely happy to be back in Shanghai," he said. "I honestly feel great and I want to stay here as long as possible."
Medvedev is popular with Chinese fans, a chemistry on display when the indoor match was interrupted briefly after a red-and-white butterfly distracted the Russian from serving.
The crowd giggled as he played up his surprise for comic effect, before carefully handing over the insect, which had settled on one of his tennis balls, to great applause.
"I'm a little bit, not scared of insects, but, like, I don't like when they go on me," Medvedev said at a press conference afterwards, though he added it was "perfect for me" upon hearing they were a symbol of good luck in China.
The Russian next plays 26th-ranked Sebastian Korda, who beat him at their last meeting.
"He was very dominant, in a way, and that's how he plays, so it's going to be interesting for me," said Medvedev.
"I'm in a good shape now, so I will try to do better than last time and try to win."
Sinner prevails
Sinner, who defeated both Alcaraz and Medvedev on his way to winning the China Open this week, had a more challenging route to the third round in his Shanghai Masters debut.
The world number four snatched a nail-biting first set 7-6 (9/7), before coming back strong in the second set for a quick 6-2 victory.
"(Giron) is a very, very good player... The first set is never easy, I got lucky a little bit but sometimes you need a bit of luck," Sinner said after the match.
"In the second set I was able to raise the level a bit... so I'm very happy with that."
Fourth seed Stefanos Tsitsipas is also through to the next round after a straightforward job dispatching Australian qualifier Rinky Hijikata 6-4, 6-2.
"I was very confident and very sure of what I was doing and what I was following and it worked out pretty well," Tsitsipas said.