At an affordable-housing rally in Chinatown this summer, Long Lin strode out in front, hauling a white bucket he played as a drum. “Keep tenants in their homes!” the 16-year-old chanted as he marched toward the Chinatown Gate with other protesters. “Keep tenants in their homes!”

Lin moved with his parents to Boston’s Chinatown six years ago from Guangzhou, China, a densely populated trading port. They settled in the immigrant-heavy neighborhood because “it felt like home” and because rent for their two-bedroom apartment on Tyler Street, roughly $1,200 a month, was manageable.

Lin, whose parents speak little English, worries what would happen if they were forced to move. It’s a fear that looms large in Chinatown, where developers, capitalizing on the neighborhood’s proximity to downtown, are building new luxury apartments, and residents are becoming casualties of increased property values and rents.

Only 20 percent of the 2,765 new units approved for construction in or around Chinatown will be regarded as affordable housing, according to July figures from the City of Boston. The rest will be rented at market value, which, for a one-bedroom apartment, could be as much as $3,000 a month — more than most working-class Chinatown families can afford. “We’re all afraid,” Lin said. “We’re all part of this community, and we don’t want to leave.”

It is a story unfolding in ethnic neighborhoods in big cities across the county, said Mark Huppert, a senior director of the National Trust for Historic Preservation.

The fate of one tattered building, at 25 Harrison Ave., offers a case study of the past and future of Chinatown.

Jessica Rinaldi for The Boston Globe

Protesters called attention to worries about the end of affordable housing in Chinatown, where developers are building new luxury apartments and residents are becoming casualties of increased property values and rents.

In February 2012, firefighters investigating a false alarm at the boarding house discovered a raft of building code violations. Pipes sat corroded in the bathrooms, and black mold grew in the ceilings, but rent was cheap, sometimes as low as $400 a month for a room, so residents had not complained.

Conditions were so wretched that city inspectors ordered a full evacuation, forcing about 40 dwellers to leave.

Xi Xiang Li, 66, whose memories of the building drift to dirty hallways, oil stains in the kitchen, and the scurry of cockroaches, remembers the day he was told to leave. Everything was chaotic, he said, and as he evacuated, he wondered where he would go, and if he could ever afford to come back.

He and the other tenants were relocated by the city, many to a housing development in South Boston. More than a year later, the future of the Harrison Avenue building, and whether residents will be able to return, remains uncertain.

For a while, Hodara Real Estate Group of Boston had plans to renovate the boarding house. Each unit, essentially one room complete with a leather couch and flat screen TV, would rent for about $1,400 a month, more than double what some once had fetched. But in mid-July, the Hodara group withdrew, leaving the fate of 25 Harrison and its displaced tenants with owners Alexander and Julie Szeto of Southborough. The city’s Inspectional Services Department cited the owners for a slew of violations when the squalid conditions were discovered.

Alexander Szeto said in a phone interview he hopes to keep the building affordable, depending on the cost of renovations, which are likely to be extensive.

“If he fixes the building up and makes it affordable, it would be great to move back,” Pai Chao Lin, 64, said through a translator. He was relocated to South Boston after the evacuation. “I don’t speak English, and it’s important to have a place for immigrants to settle in. My children will be moving to America soon, and they’ll need to live in Chinatown.”

Chinatown is a lifeline for many, said Mark Liu, programs and operations director of the Chinese Progressive Association, a neighborhood activist group. The enclave provides access to Asian grocery stores, bilingual health facilities, and a community of shared values and experience — especially for new waves of emigres.

“Our residents deserve to live here, and many of them need to live here,” he said. “But more and more are being displaced. Chinatown should not be for sale.”

Easier to stay than leave

Chinatown traces its roots to the late 1870s, when Irish workers went on strike at a shoe factory in North Adams. Chinese workers, who accepted lower wages, were brought in from San Francisco to replace the Irish, and, when the contracts of Chinese laborers expired, many migrated to Boston to find more work, historians believe. They settled around Beach Street, where rent was known to be low.

Once settled, it was easier to stay than to leave, especially because racial discrimination kept them out of predominantly white neighborhoods. But when the Central Artery was built in the 1950s, construction displaced hundreds of families. And more were forced out in the next few decades by urban renewal and the expansion of Tufts Medical Center. Large Chinese communities arose in Quincy, Cambridge, Malden, and elsewhere.

“Entities were grabbing land in Chinatown, and families and businesses were being pushed out by the hundreds,” said Thomas Chen, a Tufts University lecturer who serves on the board of the Chinese Progressive Association and is writing his dissertation on the history of Boston’s Chinatown. “It’s the historical context for what’s happening now.”

The influx of high-end developers in Chinatown is a relatively new phenomenon, said Sheila Dillon, director and chief of housing for the Department of Neighborhood Development. In 2010, there were 2,114 residential units in Chinatown, of which 987 — or nearly half — were deed-restricted as affordable.

That was an “amazing number,” Dillon said. But, three years later, that percentage has shrunk and keeps shrinking.

Years of neighborhood activism have transformed Chinatown, once a seedy part of an adult entertainment district, into coveted real estate. “I just love Chinatown, and everything going on there,” said Alex Hodara, owner of the Hodara Real Estate Group.

To provide an alternative to high-end development, the city is building four developments in Chinatown that will create 416 units of affordable housing, which generally targets households making extremely low income (in Boston, about $28,300 a year for a family of four) to moderate income (about $67,350 a year for a family of four).

Many families in Chinatown make even less. So the federal government subsidizes housing with Section 8 vouchers: The family spends 30 percent of its income on rent, and the federal government makes up the difference. But this year, the Boston Housing Authority saw the federal government impose $10 million in Section 8 voucher cuts. The Boston housing agency stopped issuing new vouchers, and by fall, it could end subsidies for more than 10 percent of the approximately 11,000 households that already receive them.

“We can only create affordable housing with the resources we have,” Dillon said. “And our resources have been cut.”

That harsh reality leaves many in Chinatown with a Catch-22: The harder residents work to make Chinatown an attractive place to live, the more likely new developers will increase rent, forcing them out.

“The Asian community has been here for almost 150 years,” Liu said. “We’ve made it home, we’ve made it a good neighborhood with [English as a second language] classes, workforce development, youth programs, community centers. We don’t want to build up our whole community, make it look nice, and then be forced not to live here anymore.”

Neighborhood connection

Long Lin stopped drumming as the rally reached its last stop. The marchers stood before 25 Harrison, the neighborhood’s most poignant symbol of neighborhood displacement, and Lin thought about his own home, just a few blocks away.

Lin feels especially connected to this neighborhood. He is a proud member of the Boston Chinatown Neighborhood Center, and through its youth center has made snowboarding trips and organized an Asian-American performance showcase. He has friends here, he said, and everything is familiar.

“This is where I belong, and it’s where I grew up as a person,” he said. “If I moved, I’d be missing out.”

Huppert, at the National Trust, said modern cities must figure out how to encourage development and economic prosperity without forcing people, like Lin, to leave the places they call home. It will be one of this era’s greatest challenges, he said. “We don’t want to stifle progress because progress is important for cities,” he said. “But we must maintain a balance between progress and protecting what’s important in these places: their ethnic diversity as well as their economic diversity. We must bring in new development while still encouraging small and minority businesses.”

For now, in Boston, that balance seems elusive. In front of the Harrison building, rally members stopped chanting, and the group began to sing a variation on a classic Chinese love tune. Looking around, Lin sang: “How long will Chinatown be like this?”