The recent volatility in the markets should serve as a reminder of how unstable things might be if a recession hits. It's important for investors to try to prepare themselves for less-than-ideal economic conditions. One way to do that is to invest in discount retailers that may see sales rise when consumers look for ways to reduce spending amid more challenging times.

Below are two stocks that stand out today as options for investors looking to go this route.

1. Dollar Tree

Dollar Tree (DLTR) stock has just about doubled over the past five years, and business is still doing well, with the company recently announcing that it would be hiring over 25,000 associates in anticipation of the holiday season. With more than 15,000 locations in North America, Dollar Tree is a convenient, cost-effective choice for consumers. The company may not have generated a lot of growth recently, but revenue has been above $20 billion over the past three years and the company has been on the Fortune 500 list for 11 straight years.  .

Since fiscal year 2017, Dollar Tree has also made an operating profit of at least $1.7 billion. Unlike net income, which can often involve a lot of noise relating to non-operating expenses, operating income is a better measure of the company's overall strength. And with that much in profit, Dollar Tree is in a solid position to be able to take on any adversity that comes its way during less-than-ideal economic times.

The aisle of a store with packed shelves on both sides.

IMAGE SOURCE: GETTY IMAGES.

And if a recession hits, its sales numbers could get even stronger as consumers adjust their spending habits to help make ends meet. With a wide variety of items ranging from household goods to toys to frozen food, Dollar Tree can be a cost-cutting option for many different types of customers.

Dollar Tree could also be making a bit more money per consumer as, with the introduction of Dollar Tree Plus, the company recently began offering items at more than just the $1 that consumers have been used to. And with the company's acquisition of Family Dollar back in 2014, Dollar Tree in the next recession will be able to sell to more customers and offer different options to meet customers' desires, including for alcohol, which it plans to sell in 1,000 Family Dollar stores that it's looking to renovate this year.  

2. Ross Stores

Ross Stores (ROST) is not a dollar store, but the discount retailer is another popular option that provides consumers with a lot of value. While it's on a much smaller scale -- with just over 1,500 locations across the U.S. -- it has still been able to generate significant growth in recent years.

Sales grew from $11.9 billion in fiscal year 2016 to $15 billion in fiscal 2019, for an increase of more than 25%. Profits, meanwhile, have risen at an even more impressive rate, going from $1 billion to $1.6 billion in just three years, a 60% jump. While the company's margins and operating expenses have remained consistent, Ross benefited from lower taxes in its most recent fiscal year, paying less (3% of revenue) than it did in 2016 (5% of revenue). The enabled more of its incremental revenues to trickle down to its net income.

Like Dollar Tree, Ross Stores has been able to produce some very strong numbers. And with Ross Stores marketing itself as selling items as much as 60% cheaper than department stores, it, too, could get much more traffic during a recession. 

Why both stocks could be great for investors

During the last recession, both Dollar Tree and Ross Stores vastly outperformed the S&P 500.

DLTR Chart

DLTR data by YCharts.

Although the next recession will be triggered by different factors than the last one, discount retailers like Ross and Dollar Tree could still be poised to cash-in. With many retailers struggling and some going out of business, competition from brick-and-mortar locations could actually be reduced. The one place where discount retailers will face more competition during the next recession will be online, where consumers are now spending more of their money. However, the convenience and thrift of dollar stores and the treasure-hunt experience that brings shoppers to Ross stores could make these companies less exposed to the risks of online shopping, even in a downturn.

These companies have been able to grow amid the rising popularity of online retail and with population growth over the past decade and thus more consumers available than during the last recession, these two companies could do well when the economy next struggles.

The stocks have demonstrated a lot of strength and the stores' potential to draw in customers even as discretionary incomes fall makes both stocks appealing for investors who may be concerned about the future.

While there's no guarantee that either stock will be able to outperform the S&P 500 during another downturn, the strength of their business models and wide appeal of their products give Ross Stores and Dollar Tree good odds for success, regardless of what challenges may be in store for the economy as a whole.