Amazon shares fell sharply in after-hours trading after the company reported losing $126 million in its second quarter, the web retailer's biggest loss since 2012.

As the chart below shows, this is a company that shoots for sales, not profit margins. Chief executive Jeffrey P. Bezos famously likes to think over the long-term, pouring money back into the company to chase new opportunities. This quarter, the company has been especially ambitious, launching several new services and entering the smartphone market with the Amazon Fire Phone. Sales at the mega-retailer reached $19.34 billion, up 23 percent compared to the same period last year.

But with a loss of 27 cents per share, as opposed to analyst estimates of a 15 cent per share loss, some investors appear to be running out of patience. Shares were down about 10 percent in after-hours trading from the stock's closing price of $358.61 per share.

In an earnings release, Amazon chief executive Bezos, who also owns The Washington Post, highlighted several investments that the company has made to improve customer service--unsurprising given that one of Bezos' guiding principles is "customer obsession."

"We continue working hard on making the customer experience better and better,” he said in a statement, listing initiatives such as the addition of Sunday delivery coverage to 25 percent of the United States, the Prime Music streaming service, the development of several original video series and the Kindle Unlimited reading program, which allows people to get unlimited e-books for $9.99 per month.

The company's two biggest expenses last quarter were shipping and the cost of acquiring content such as the TV shows that it streams to Prime members.

The amount Amazon spent fulfilling retail orders rose 27 percent over the last year to $2.3 billion in the most recent quarter. It spent another $2.2 billion on "technology and content" this past quarter, up from $1.59 billion in the same period last year. The company buys the rights to a massive amount of TV shows and movies in order to drive consumers to its Prime service and to pick up Amazon devices such as its Kindle tablets and new Fire phone. Total media sales, which includes books and digital movies, reached $2.46 billion.

Bezos has long said he's not concerned about quarterly results, saying instead that he's focused on long-term rewards.

"We want to make money when people use our devices, not when they buy our devices," he said at a 2012 product launch.

Have more to say about this topic? We take your questions every week in our weekly livechat, Switchback, Fridays at 11 a.m. ET. The comment box is open, so submit your questions now.