In Nairobi and other major metropolitan areas in East Africa, shopping centres, supermarkets and hotels are typically protected by gates and staffed with security guards.
It is routine for cars that visit high-end complexes regularly to be checked multiple times a day; security officials often run mirrors under vehicles to check for explosives before allowing them to enter.
In Nairobi, passengers headed towards Jomo Kenyatta International Airport must exit their vehicles far from the entrance and pass through metal detectors on the side of the road while their vehicles are checked separately.
"You're trying to balance convenience and ease of access and not creating hardship in daily lives with protecting from an incident like this," said Omar Mahmood, a senior researcher at the Institute for Security Studies in Addis Ababa, Ethiopia.
But even with increased security, "the reality is when you have an actor as sophisticated and capable as al-Shabaab that's determined to attack you, unfortunately, they're going to get past you," he said.
Nairobi is a major international hub, home to many embassies, businesses and hotels. In 1998, the US embassies in Nairobi and Tanzania were targeted by al-Qaeda militants. More than 200 people were killed and thousands injured, the vast majority of them in the Nairobi attack.
Al-Shabaab has repeatedly attacked Kenya, which deploys troops to Somalia as part of an African Union peacekeeping mission there. Al-Shabaab militants have killed hundreds in Kenya in recent years, including at Garissa University in the northeast, where gunmen killed nearly 150 people in 2015.
Mark Bellamy, the US ambassador to Kenya from 2003 to 2006, told the Washington Post that although revamped security in recent years may have deterred some terrorists, it is not a surprise that "there's been another attack like this against an upscale target".
"If you accept that this is a problem that Kenya is going to continue to have," Bellamy said, then authorities need to "harden those targets . . .[and] have an effective response".
"It's probably not going to be possible to prevent such attacks," he added. "But it should be possible to make them less deadly."
Mahmood said that Kenyan security forces have thwarted other attacks in recent years and that finding ways to prevent sporadic violence is a challenge for any country facing such threats.
He said he expected increased security and vigilance in the aftermath of the attack. One "unfortunate consequence of that could be higher walls, more sort of physical security barriers," he said.
But as is the case elsewhere, he said, there will be a "natural tendency over time for that to dissipate".