Even as worries persist about the global economy and the Fed's efforts to curb inflation, some industries continue to show signs of resilience. For example, e-commerce is on track to hit a global valuation of $8 trillion by 2027. Even in a recession, the trend to buy products online will continue. 

The healthcare industry is another intriguing space that can withstand a wide range of market environments. This is an industry generally known for its non-cyclicality because consumers need medicines and surgeries regardless of what's happening with the state of the economy. 

On that note, here are two unstoppable stocks, one from each of these industries, to consider adding to your buy basket now. 

1. Shopify 

Shopify (SHOP -1.85%) has gone through quite a lot of changes over the last year. Investors seem to be increasingly optimistic about the company's long-term prospects in a post-pandemic world. Shares of the stock are currently trading up by more than 60% from the start of this year.

As a long-term shareholder of the stock, I'll be the first to admit that a challenging economic environment and the struggles Shopify has faced in terms of profitability and moderated growth in recent quarters have been difficult to stomach. Still, I believe that Shopify's leadership in the multitrillion-dollar e-commerce market and the strength of its underlying business remain key advantages that it can leverage over the long term.

It also wasn't reasonable to expect its pandemic-level pace of growth to continue indefinitely. Let's take a step back to look at the bigger picture, though. Since the company's inception less than two decades ago, it has helped to facilitate more than $700 billion in commerce sales globally. Today, millions of merchants across more than 175 countries use Shopify's technology to sell to customers both online and offline.  

In 2022 alone, more than half a billion customers purchased something from a store built on Shopify. Not only are an incredible 22% of all e-commerce websites globally built on Shopify, but the company has managed to capture 10% of the U.S. e-commerce market. Bear in mind, the U.S. represents one of the largest and fastest-growing e-commerce markets globally and is on track to hit a valuation of $1.6 trillion by the year 2027.

While some of the recent changes Shopify has made -- such as shaving its workforce by about 20% and selling its logistics business to Flexport -- may seem abrupt to some investors, I firmly believe these are operational decisions that can help the company move toward sustained profitability in the long run.

Management has been clear that this goal remains top of mind. There's no way around it; this isn't the same operating environment that Shopify or other companies of its kind faced a few years ago in the supercharged growth period of the pandemic. And Shopify, like many other companies, initiated hiring streaks that are no longer sustainable. 

On a positive note, the company returned to profitability in the first quarter of 2023, reporting net income of $68 million. It also generated revenue of $1.5 billion and monthly recurring revenue (MRR) of $116 million, up 25% and 10% year over year, respectively.

Consumer spending patterns may continue to shift in the coming quarters, particularly if a recession comes. However, Shopify's tightening of the belt, so to speak, even as it continues to widen its moat and improve its financials in an otherwise challenging landscape, can strengthen the foundation of its long-term growth story.

Investors may want to take note of and capitalize on this investment opportunity, regardless of what the market does in the coming quarters.

2. Intuitive Surgical 

Intuitive Surgical (ISRG -1.04%) has remained one of the singular titans in the surgical robotics industry for over two decades now. Even as other large healthcare companies have introduced their own surgical robotics products into the market, none have come close to disrupting the massive market share that Intuitive Surgical controls.

At last count, that market slice came to around 80%. Bear in mind that some estimates show that the global surgical robotics market could be valued at close to $100 billion by the beginning of the next decade as the demand for these systems for use in both minimally invasive procedures and open surgeries grows.  

Over the last few years, the industry in which Intuitive Surgical operates has dealt with a series of dramatic shifts. When the COVID-19 pandemic struck, many surgical procedures were canceled or delayed. Even though much of the world has recovered from the worst of the pandemic, case resurgences in key markets, such as Asia, have impacted procedure volumes. 

In addition,the reality of elevated inflation and a shortage of healthcare workers has caused hospitals to see a significant rise in the cost of doing business -- which, in turn, has impacted the growth in surgical systems that Intuitive Surgical is placing with its customers. 

Against this backdrop, Intuitive Surgical has continued to expand revenue, remain profitable, and increase the number of systems it installs and trains its customers on. This is because the company not only generates revenue from its surgical systems but also recurring revenue from software, training, customer support, and other services. 

In fact, in the first quarter of 2023, recurring revenue comprised 81% of the $1.7 billion in total revenue that Intuitive Surgical recorded for that period. Not only was the company's total revenue up 17% year over year on a currency-neutral basis but recurring revenue was up 21% from the year-ago period. Net income came in at $355 million.

Intuitive Surgical finished out the quarter with 12% more of its flagship da Vinci Systems installed for customers globally than in the prior-year quarter. The company's revenue model and steady growth, even as procedure volumes are still recovering, is a testament to the strength of its underlying business.

Investors that stay with this healthcare stock for the long haul should reap the rewards of this growth story.