With technology stocks garnering renewed scrutiny, it's helpful to take a look back at one company that has weathered some of the most severe market downturns and serious doubts from Wall Street: Amazon. Betting on the online bookstore wasn't always a sure thing. Amazon's journey from tiny garage start-up to one of the most valuable companies in the world has paid off for investors, but shareholders needed a strong stomach.

"Earth's Biggest Bookstore"

In the early 1990s, Jeff Bezos walked away from a Wall Street career with an outlandish idea to sell books on the World Wide Web. In 1994, he launched Amazon.com. "I found this fact on a website that the web was growing at 2,300 percent per year," Bezos told CNBC in a 2001 interview about his early foray into book selling. "The idea that sort of entranced me was this idea of building a bookstore online." The site experienced growth quickly, going public three years later with $16 million in revenue and 180,000 customers spanning more than 100 countries (according to its SEC filing). But even as the site began growing, many investors had their doubts about Amazon, instead favoring brick-and-mortar book-selling giant Barnes & Noble. At an early meeting between Barnes & Noble Chairman Leonard Riggio and Bezos, Riggio reportedly told Bezos he would "crush" Amazon. Barnes & Noble dwarfed the young start-up. The traditional bookseller had hundreds of stores and more than $2 billion in revenue. It was also tapping into major Silicon Valley talent to built its own sleek new website. On top of that, it was suing Amazon over the start-up's claim to be "Earth's Biggest Bookstore." But for those who took a chance and bought Amazon stock at the initial public offering, their investment has returned a compound annual growth rate of 38 percent since the IPO – outperforming the S&P 500 which had a total return of 10 percent annually over the same period.

The dot-com bubble

Amazon's next big hurdle? The dot-com bubble. In the late 1990s, dot-com companies became all the rage on Wall Street. Amazon's customer growth and savvy capital fundraising combined to help it rapidly expand its offerings. Soon books became just one part of an expansive online retailer connecting customers with everything from power tools to Pokemon cards. The company's valuation soared, hitting more than 50 times its IPO value in December 1999. But Nasdaq peaked shortly after on March 10 2000, at 5,132.52. And the bubble burst, sending the composite down to barely 1,100 by October 2002. As the crash set in, dot-com companies began folding left and right. Geocities, Webvan and Boo.com were suddenly gone. Hot start-ups like Pets.com and Kozmo that Amazon had invested in itself disintegrated. Amazon's stock tumbled month after month as well, losing more than 90 percent of its value in two years. The company weathered the storm, reportedly because of shrewd management and a lucky last-minute infusion of capital right before the bubble burst. But even for those who bought in at Amazon's dot-com era peak, the investment still paid off. A $1,000 purchase of Amazon in December 1999 would be worth $15,500 today.

Big ideas

The mid-2000s brought a period of both skepticism and immense growth for Amazon. As the company recovered from the brutal dot-com crash, it rarely returned money to investors or made a profit. But Amazon was aggressively reinvesting its revenue. The company continued to expand its customer base and its retail offerings. It also began experimenting with and investing in big new ideas that would payoff later like Amazon Prime, Amazon Web Services and the Kindle. Still, the company's stock struggled to outperform its dot-com era highs throughout the 2000s as investors wrestled with fears that the lack of profitability meant it also lacked long-term value.

Amazon hits its stride

Coming out of the 2008 financial crisis, Amazon began growing into the modern company — involved in virtually anything and everything — that it is known for today. It released the Echo powered by virtual personal assistant Alexa as well as a successful line of tablets. It launched Prime Video and began producing its own original video content. It also began breaking into brick-and-mortar retail with its own Amazon book stores and the purchase of Whole Foods.

Can the long bet last?