Warren Buffett is one of the most accomplished investors in American history. His value-oriented philosophy helped Berkshire Hathaway build a $318 billion equity securities (stock) portfolio, nearly two-thirds of which is unrealized gains. That portfolio has outperformed the S&P 500 by about 14 percentage points over the last three years.

Given that track record of success, investors in search of opportunities might want to consider investing alongside Berkshire by purchasing shares of Snowflake (SNOW 4.22%) and Mastercard (MA 3.08%). These two stocks look attractive at their current valuations, and now also happens to be a good time to put money into the market. The S&P 500 is currently 9% off its high, but history says the next bull market is a function of time. It will happen sooner or later. That matters because the S&P 500 returned an average of 186% during the last nine bull markets, and Snowflake and Mastercard could soar during the next one.

Let's find out a bit more about these two Warren Buffett stocks and why they might make great long-term holdings.

1. Snowflake: Digital transformation is driving demand for data analytics tools

Snowflake looked sharp in the second quarter. Its customer count increased 25% to 8,537, and the average customer spent 42% more despite challenging economic conditions. In turn, revenue rose 37% year over year to $640 million and non-GAAP net income reached $81 million, up from $5 million in the prior year. Investors can expect similar momentum in the coming years.

Snowflake helps clients manage and make sense of big data. Its platform handles a range of workloads that otherwise require a complex patchwork of point products, including data engineering (ingestion), data lakes (storage), and data warehousing (analytics). Snowflake also supports secure data sharing. That lays the groundwork for a powerful network effect because its platform becomes incrementally more valuable with each new data set.

Growing demand for artificial intelligence (AI) could kick that flywheel into overdrive. Data is critical to training machine learning models, and enterprises often augment their internal data with external data. Snowflake provides access to external data through its marketplace. To quote Snowflake CEO Frank Slootman, "Data sharing makes Snowflake uniquely positioned to enable AI workloads."

Not surprisingly, Snowflake is becoming a core part of cloud strategy for many enterprises. A recent survey from Morgan Stanley identifies vendors expected to gain the largest incremental share of IT spending over the next three years, and Snowflake ranked third behind Microsoft and Amazon. That means Snowflake beat every other cloud-based infrastructure and software vendor.

To that end, Morgan Stanley expects Snowflake to grow revenue at 31% annually over the next five years. In that context, its current valuation of 21 times sales seems reasonable. That's why this Warren Buffett stock is worth buying today.

2. Mastercard: Digital transformation is driving the world toward electronic payments

Mastercard reported solid financial results in the second quarter amid resilient consumer spending. Revenue rose 14% to $6.5 billion due to double-digit growth in dollar volume and switched transactions, and non-GAAP net income soared 23% to $3.2 billion due to excellent cost control and share repurchases.

Mastercard is well positioned to maintain that momentum over the long term given its durable economic moat, which arises from brand authority, network effects, and scale. The Mastercard brand is recognized and trusted by banks, merchants, and consumers around the world. That ubiquity has enabled the company to build an acceptance network rivaled only by Visa (V 4.81%).

The combination of brand authority and near-universal acceptance creates a powerful network effect, a virtuous cycle where each new cardholder makes Mastercard incrementally more compelling for merchants, and each new merchant makes Mastercard incrementally more valuable for consumers. That network effect would be virtually insurmountable for a new competitor.

Beyond that, Mastercard is the third-largest card payments network as measured by purchase transactions. That scale allows Mastercard to earn higher profit margins than smaller payments companies like American Express and PayPal because it can spread costs over more transactions. That dynamic reinforces itself by enabling Mastercard to reinvest more heavily in growing its business.

Visa benefits from the exact same advantages discussed above, so readers may wonder: Why not buy Visa? To which I would respond: Why not buy both? However, if forced to choose one, I would choose Mastercard because it derives a larger portion of its dollar volume from international markets. That is advantageous because (1) Europe is a hotspot for cross-border fees and (2) the digital payments industry is less mature in many international markets as compared to the U.S.

So what? Mastercard tends to grow dollar volume more quickly than Visa because of the dynamic discussed above, and that should translate into faster revenue growth in the future. But Visa currently trades at a higher price-to-sales multiple, and that makes Mastercard the more compelling buy. That said, Buffett has a stake in both companies through Berkshire.

Here's the bottom line: Digital payments revenue is expected to grow at 6.2% annually over the next five years, but Mastercard should handily outpace the industry given its strong market presence. Indeed, Morningstar analyst Brett Horn expects Mastercard to grow revenue at 12% annually over the next five years. That makes its current valuation of 15.2 times sales look quite reasonable. That's why this stock is worth buying.