Stock market indexes are sitting near all-time highs and have been showing no signs of slowing down. The gravy train will end at some point and the indexes will likely correct, but it is anyone's guess as to when that will occur.

Whether the stock market begins to drop next week or next year, investors can sleep tight owning these two stocks that have proven themselves. These two surefire companies have the potential to thrive in any environment, which is why I would buy Shopify (SHOP 0.14%) and Airbnb (ABNB 1.09%) in a heartbeat.

Person leaning on a couch with a computer in their lap.

Image source: Getty Images.

1. Shopify: Becoming a leader

Shopify has become an established player in the e-commerce space. With over 1.7 million merchants using Shopify to establish an e-commerce presence and grow their online footprint, Shopify has gained nearly 9% market share in e-commerce sales in 2020. What makes Shopify an appealing investment today is what is on the horizon. 

The company plans to roll out Shopify Fulfillment in the coming years, which is going to be the foundation of a fulfillment network. It will help businesses pack, ship, and manage their distribution needs. Shopify also has solutions like Shopify Markets, which make it easy for businesses to expand their global e-commerce networks. Businesses can enter new geographies with ease and access new growth opportunities that may have never seemed possible.

Shopify's unrelenting focus on its customers' success has led to massive growth for the company. In its third quarter, it reached $400 billion on cumulative gross merchandise volume, which doubled in just over 16 months. Despite its large footprint among small and medium-sized businesses (SMBs), Shopify doesn't want to stop there. Management sees a $153 billion opportunity in the SMB space, which is massive compared to the company's $4.2 billion in trailing-12-month revenue.

Shopify's additions of Shopify Fulfillment and Shopify Markets could help the company attract even more merchants beyond the nearly 2 million it currently supports. Additional merchants and expanding footprints would likely contribute more to the company's increasing cumulative gross merchandise volume.

As if the company couldn't get any better, it is profitable and generates plenty of free cash flow. So far in 2021, it has produced $641 million in adjusted net income and $219 million in free cash flow. While the company trades at 41 times sales, Shopify is by no means cheap. However, the company has the opportunity to not only dominate the lucrative SMB market but also enter the multi-trillion-dollar global e-commerce space. With its nice profitability which will likely continue because of its subscription and fee business model, Shopify looks like a no-brainer stock to own for decades. 

2. Airbnb: Uniqueness at the core

Airbnb has been leading the charge of the recovery for hospitality and travel stocks. In its recent quarter, the company reached an all-time quarterly revenue record of $2.2 billion -- which grew 36% compared to third-quarter 2019. Even large established hospitality stocks like Hilton Worldwide (HLT -0.83%) are still far off their pre-pandemic revenue figures.

The key to Airbnb's success as a business has historically been the uniqueness of its stays. Airbnb hosts offer stays in treehouses, remote cabins, and even a potato (yes, a potato). These unique stays drive users to the platform, which makes it more valuable for hosts to join and provide more unique places to vacation. This has led to Airbnb becoming a major player in the vacation hospitality space, with nearly 80 million nights and experiences booked in Q3 alone.

To continue driving this network effect, Airbnb has been making it easier and safer than ever to become a host, investing in numerous features like damage protection, faster reimbursement turnarounds, and liability insurance for its hosts. Even after these investments, Airbnb is still profitable. The company brought in over $830 million in net income and $518 million in free cash flow in Q3. Considering that it has spent over $621 million on operations and support expenses so far this year, this profitability is quite impressive. It also demonstrates the company's ability to fuel growth and customer satisfaction while rewarding shareholders. 

Management does not think that Airbnb is out of the woods yet with the pandemic. In the Asia Pacific region, Airbnb continues to see depressed bookings, particularly in two big markets: Asia and Australia. This means that in the short term at least, the company expects stunted growth as parts of the world continues to emerge from the pandemic. Aside from these reported areas of stunted growth, Airbnb has maintained income and success showing resilience, easing any potential concerns of investors.

While looking at the short term can be nice, it's the long term where investors should be more focused. The pandemic highlighted the ability to work from home and have side hustles that allow individuals to work from anywhere, and consumers will likely take advantage of that. Airbnb has become the primary place people can go to find unique places to work from, and that could propel them forward over the next five years. That is why I will continue to like Airbnb through any market downturn.