A record number of retail stores closed this year, capping off a decade of dramatic changes to consumer preferences as a result of online shopping that roiled the industry.

Retailers announced more than 9,300 store closures this year, a 63 percent increase from 2018, when more than 5,700 stores closed, according to Coresight Research, a global advisory and research firm specializing in retail and technology. The last record year came in 2017, when more than 8,000 stores shuttered.

But some retail analysts say the industry was due for trimming after a decadeslong mall boom that followed consumers into the suburbs. After World War II, the economy heated up and consumers left urban areas to buy new homes in the suburbs. Retail developers quickly followed by opening up a new mall every year. At their peak, 19 new malls opened in 1990.

Not every retailer needs 100 stores. It’s about the industry right-sizing, rather than about a retail apocalypse.”

“Even without the advent of online, there would be this reckoning,” Michael Brown, a retail practice partner with the global management consulting firm A.T. Kearny, told NBC News. “What online has done is make it really expensive to continue operating a large store base, and with a competitive online experience there had to be a rationalization for the number of stores and the role they played.”

This year's record number of store closures has touched nearly every part of the retail industry, from apparel to toys, and was driven in part by a slew of company bankruptcies. For many of these companies, bankruptcy and store closures are an opportunity to right size their store footprints and shed expensive real estate.

Payless ShoeSource filed for bankruptcy in February for the second time and shut down all 2,500 of its North American stores. The company struggled with massive debt and said supplier delays forced it to sell its inventory at deep discounts. Teen retailer Charlotte Russe also filed for bankruptcy, and said it would close 94 stores. North American fashion house YM bought the company in March and plans to relaunch 100 new locations across the country. Barneys New York plans to close 15 out of its 22 stores as part of its bankruptcy. Its new owner, Authentic Brands, plans to open a pop-up shop in the summer of 2020 on Madison Avenue in New York City to give the company “an opportunity to attract a new customer that they don’t necessarily have today,” said Jamie Salter, CEO of Authentic Brands.

Other companies closed their stores completely in 2019. Payless ShoeSource filed for bankruptcy in February for the second time and shut down all 2,500 of its North American locations. The company struggled with massive debt and said supplier delays forced it to sell its inventory at deep discounts. Accessories chain Charming Charlie filed for bankruptcy in July and said it will close 261 of its stores by the end of August. The company said it wasn’t able to come up with a long-term profitability strategy.

While fewer shoppers are heading into stores to shop, their sales are becoming more valuable, Lauren Bitar, a retail consultant with the analytics firm RetailNext, told NBC News. Between January and December 20, retail store traffic was down by about 5 percent and net sales were down by around 2 percent, according to RetailNext. But the average transaction amount increased by nearly 3 percent and the sales value per shopper increased by about 3 percent.

This trend is in part because more shoppers are researching products online and then buying them in store. That, in turn, has meant brands are investing in their staff, in order to improve the customer experience. Many companies have started increasing wages and adding health benefits to bring in top sales talent.

“Store staff has really been a commodity in the past — they lost the ability to engage with consumers,” said Brown. “But as wages go up retailers are really going to need to invest in staff in stores to be more productive and to be additive to what a consumer is buying.”

Heading into 2020, the retail industry is expected to shed more real estate. Online sales are expected to rise to 25 percent from 16 percent by 2026, according to UBS. That means roughly 75,000 more retail stores would need to close. But that doesn’t mean stores are now obsolete.

“It’s really having the right number — not every retailer needs 100 stores,” said Bitar with RetailNext. “It’s about the industry right-sizing, rather than about a retail apocalypse.”