The past three years have been a roller-coaster ride for investors, and such heightened volatility can sometimes make it hard to focus on the long term. But that is precisely the right move. If history is any indication, equity markets will be up substantially from their current levels in a decade. All investors have to do to cash in on that is buy shares of excellent companies and be patient.

On that note, let's consider one stock whose prospects through the next 10 years look attractive: Doximity (DOCS -1.39%). Here are three reasons why investing in this healthcare-focused networking platform is a good idea, even as its stock is down nearly 40% from a year ago.

1. Doximity's high-margin business 

Doximity runs a platform that allows physicians and others in the medical field to network, look for new job opportunities, catch up on the latest research, call patients for telemedicine visits, and much more. The company makes money primarily by charging subscription fees to pharmaceutical companies and hospitals that advertise their products and job opportunities on its platform.

Doximity's online subscription-based model results in incredibly sizable margins. In its latest reporting period, the first quarter of its fiscal 2024, ending on June 30, Doximity reported a gross margin based on generally accepted accounting principles (GAAP) of nearly 88% and a net profit margin of 26.2%. In both cases, these metrics slightly improved compared to the year-ago period. It's hard to say what an objectively good profit margin is.

That depends on factors such as industry, the size of a business, etc. But the overwhelming majority of companies on the market would happily welcome gross margins that approach 90%, and few can pull that off. Healthy margins matter, and Doximity's high-margin model is a crucial reason for long-term investors to consider the stock. 

2. Building a competitive advantage 

Having an economic moat is essential for all businesses that stand the test of time. There are various ways to do so, one of which is to create a network effect. This is when the value of a service increases with use. That's what grants Doximity's business a solid competitive advantage. Imagine being a physician trying to network with other physicians.

It only makes sense to opt for a platform that many of your colleagues already use. Doximity estimates that over 80% and 90% of U.S. physicians and graduating medical students (respectively) use its platform. But the same logic works for pharmaceutical companies and hospitals, which value being able to put offers and advertise their products directly to medical professionals.

The more physicians to advertise to, the better. That's why the 20 largest pharmaceutical companies and the top 20 health systems all use Doximity's platform. Over the long run, the network effect Doximity has created should allow it to keep most of its users while attracting new ones. The company's retention rates for its subscription services routinely come out above 100%.

During its latest quarter, it was at 118%, although that was a decline from the 139% reported in the year-ago period. Still, Doximity's high retention rates make sense, given its platform's network effect. The company's ability to grow its business in this way should also help its revenue and earnings move in the right direction over the next decade.

3. There is a long runway for growth 

The healthcare sector will continue to grow. There is always a need for new treatment methods and new drugs. Also, the world's aging population. Physicians are responsible for much of medical care spending, for instance, by issuing prescriptions to their patients. According to Doximity, physicians control more than 73% of healthcare spending.

That's why being able to advertise directly to them the way drugmakers can on its platform is so important. Doximity estimates a total addressable market of $18.5 billion, which makes its trailing-12-month period of nearly $437 million look like chump change. Doximity is losing favor among some investors due to declining revenue growth rates. It also lowered its guidance recently in a move that upset the market and sent its stock price plunging.

But these are short-term issues. Doximity is still up against relatively low, tough comparisons to the earlier pandemic years. It is also trimming its workforce by 10%, which should further boost its bottom line and already strong margins in time. And given its solid moat and exciting opportunities ahead, Doximity looks like a solid stock to hold through the next decade.