Creating lasting generational wealth is no sure thing, no matter where you put your money. Still, there are investments you can make that are more likely to do better than others because the companies have significant competitive advantages over their peers.
Three stocks that fit this description right now are Amazon (AMZN 0.49%), Costco Wholesale (COST -0.24%), and Berkshire Hathaway (BRK.A -1.34%) (BRK.B 0.22%). Here's why each one is worth considering when building a long-lasting portfolio.

Image source: Getty Images.
1. Amazon
Amazon stock may not get as much attention these days as some high-flying artificial intelligence (AI) stocks, but the company's dominance in both e-commerce and cloud computing -- along with its expanding advertising business -- should push Amazon to the top of your buy list.
First, consider that Amazon has about 38% of the U.S. e-commerce market, easily outpacing its next closest competitor, Walmart, which has just over 6% of the market. Amazon has little to worry about as well, with the company currently having about 180 million Prime members in the U.S., who enjoy free shipping and a long list of free services like music and video streaming.
And that's not where Amazon's market lead ends. The company is also the largest cloud computing player, with its Amazon Web Services (AWS) business. AWS brought in $11.5 billion in operating income for Amazon in the first quarter, nearly double what the company's U.S. e-commerce platform earned.
What's more, Amazon has become an advertising juggernaut. Ad sales reached nearly $14 billion in the first quarter, up 18%. Amazon enjoys a unique position in the ad space because its sales come from sellers placing ads directly on its e-commerce platform or through its video streaming service. This makes its ad revenue the icing on the cake for its already lucrative services.
2. Costco
Costco makes it on this list because the company consistently offers value to its customers -- and they keep coming back for more. Costco has 140.6 million cardholders right now, an increase of nearly 7% from the same time last year, and its membership renewal is an enviable 93%.
American consumers have fluctuated back and forth between being very concerned about the state of the economy when tariffs were first announced, but have recently regained some optimism. Similarly, some of the most pessimistic forecasts for a potential recession this year have been walked back, with J.P. Morgan lowering the odds from 60% down to 40% now.
But no matter what happens with the economy, Costco customers of all income levels seem to be drawn to the store for its value. More than one-third of the company's customers have household incomes above $125,000, a notable figure that could mean Costco could weather an economic downturn thanks to these higher earners.
It's worth mentioning, too, that when consumer sentiment was low earlier this year, Costco's sales still increased 8% in the first quarter, to $62 billion. With its high retention rate, appeal to higher-income households, and its resilience even when the economy is uncertain, Costco has all the right pieces in place to continue being a great stock to hold onto for years to come.
3. Berkshire Hathaway
With legendary investor Warren Buffett recently announcing he's stepping away as Berkshire Hathaway's CEO at the end of this year (he's 94), some investors are no doubt wondering if the company can continue to be a great investment. But there are plenty of things that are working in Berkshire's favor.
First, consider that Berkshire is a very well-diversified conglomerate of more than 60 businesses. This means that these companies will continue to function under their current leadership, no matter if Buffett is Berkshire's CEO or not.
What's more, Berkshire also benefits from its portfolio of more than 30 stocks with investments totaling about $280 billion. This massive portfolio will continue to be in good hands after Buffett retires, with longtime Berkshire leadership, who've worked under Buffett since about 2010, stepping into the investment roles.
And finally, Berkshire has a very substantial $348 billion in cash and cash equivalents, giving the company's upcoming CEO -- longtime executive Greg Abel -- plenty of options at his disposal to continue growing the company. No one likes change, of course, but when you add up all of the above, Berkshire is well-positioned to move into its post-Buffett future.