It's a known fact that putting money in the stock market over the long term is one of the best ways to build lasting wealth. If you find yourself with some extra cash to invest, I recommend looking for outstanding businesses with competitive advantages that have the opportunity to compound their gains for many years. 

Etsy (ETSY -2.73%) and Roku (ROKU -0.20%) fit this description. Both of these companies possess platform business models that are driven by powerful network effects, which is arguably the best type of economic moat a company can have. Furthermore, they are riding strong secular trends that will support their growth in the years ahead. 

If I had $5,000, here's why I would invest it between Etsy and Roku.

clock with hands that say "time to buy"

Image source: Getty Images.

A differentiated online shopping platform 

Etsy is a specialty e-commerce business connecting 4.4 million sellers to 81.9 million buyers all focused on unique and creative goods. In 2020, revenue soared 111%, but because of the company's impressive scalability, net income skyrocketed 264%.

The shift to online shopping certainly received a pandemic-fueled boost last year, but don't think Etsy's best days are over. Management expects massive growth to continue this year as the business becomes top of mind for consumers. Etsy is now the fourth most visited e-commerce site in the U.S., and 88% of buyers agree that the site has items that can't be found anywhere else. 

An unstoppable virtuous cycle is at play: More buyers attract more sellers and vice versa. Etsy provides economic opportunity for its sellers to grow their small businesses. With $10.28 billion of gross merchandise sales in 2020, Etsy's value proposition for both sides of its user base is obvious, which supports its competitive advantage. 

In addition to already operating in the U.S., U.K., Canada, Germany, Australia, and France, the company just launched in India earlier this year. A country of nearly 1.4 billion people with a burgeoning middle class presents a tremendous opportunity for Etsy. 

The stock is down 15% from its year-to-date high, so investors have the chance to get in at a slight discount.

The TV operating system of the future 

While familiar services like Netflix, Disney+, and HBO Max make money by creating content and using it to attract subscribers, Roku has a different business model. It generates revenue by building a streaming ecosystem that brings together viewers, streaming companies, and advertisers.

This three-sided structure allows the business to benefit from network effects. Similar to Etsy, as more users on one side of the platform join, it creates more value to the other user groups. Sales in 2020 shot up 58%, and Roku ended the year with 51.2 million active accounts who streamed a whopping 17 billion hours of content in the fourth quarter. 

Not only is Roku riding the cord-cutting trend that could see 27% of U.S. households cancel their pay-TV packages this year, but as more viewers choose streaming, an increasing share of advertising dollars will follow. 

And this is Roku's bread and butter. Its platform segment revenue (which includes advertising) jumped 81% in the most recent quarter and now sports a remarkable 63.8% gross margin. Additionally, in the fourth quarter, the top six ad agencies more than doubled their spending with Roku compared to the prior-year period. 

From an investing standpoint, what should excite investors the most is that Roku essentially doesn't care which of the big streaming services gains the most subscribers. Its platform wins regardless, because it provides consumers a user-friendly one-stop shop for all of their viewing needs, content producers access to millions of users, and advertisers a way to spend marketing dollars in a world that will eventually be dominated by streaming. 

The stock is down 25% from recent highs, again offering investors an enticing entry point. 

Invest for the long haul 

Etsy and Roku are both fantastic businesses with strong competitive advantages built on network effects. The former is profiting from the growing importance of e-commerce, while the latter stands to gain as streaming continues to take over. Buying them to hold long term is a great play for anyone with cash to invest.