In early September, Amazon's market value briefly went over $1tn (£779bn), just over a month after Apple became the first public company in the world to achieve such a feat. Both tech companies have grown over the last few years, but will this continue?
Apple and Amazon are as different from each other as apples and oranges.
Apple is a tech company that is also a trendy consumer brand. Its computers and devices have often been must-have gadgets, and customers are willing to pay far more for their products than cheaper alternatives.
On the other hand, Amazon is where people go when they want to get a product more cheaply, more easily, or more quickly.
Since the iPhone first went on sale in 2007, Apple shares have soared by 1,100% and have jumped almost a third in the past year.
As for Amazon, the internet retail giant has seen a steady, yet speedy rise in its share price, with its market value jumping from $600bn to $700bn in just 16 days.
In contrast, the same feat took Apple 622 days.
Although Apple and Amazon offer different products and services, they are both technology firms and make up two of the five best performing technology stocks on the market - typically known as FAANG, which stands for Facebook, Apple, Amazon, Netflix and Google.
Which company has a better outlook on long term growth? Here's a look at some of the key areas for each firm, and how they are are performing.
Traditionally, most of Apple's revenues have come from its device sales - particularly the iPhone, iPad, iMac and iPod.
Apple only has a 14% share of the global smartphone market, yet its revenues consistently dwarf its nearest competitor.
According to Strategy Analytics, in the first quarter of 2018, Apple captured $61bn in revenues, whereas Samsung only achieved $19bn, followed by Huawei in third position with $8bn in revenues.
"Apple's dependence on iOS devices has been its strength, but moving forward presents its greatest challenge, in that opportunities to grow its user base will be limited," Juniper Research's head of forecasting and consultancy Windsor Holden tells the BBC.
"We don't believe revenues will decline, but the opportunity to generate significant new revenues will diminish over time, as increasingly Apple relies on creating additional value from existing customers."
Amazon has performed below expectations over the last five years with its devices, which include Kindle e-readers, Kindle Fire tablets and Echo voice-controlled speakers, but analysts say it can afford to do so.
"Amazon can sustain a model where they can sacrifice margins on devices, because they generate revenue from services and content," explains Gartner principal analyst Roberta Cozza.
In 2017, there were 1.5 billion smartphone shipments worldwide, according to Juniper Research.
However shipment growth will continue to slow down over the next five years, since most consumers in western markets now already own smartphones.
Apple also faces huge competition in all regions from Chinese Android smartphone makers, who are releasing feature-rich premium devices which are cheaper than Apple and Samsung's devices.
"In a competitive landscape where you have this level of commoditisation and low cost, it becomes risky for Apple to heavily rely on hardware sales," adds Ms Cozza.
One key area of business growth potential is the connected home.
Both Apple and Amazon have developed artificially intelligent virtual personal assistants and wireless smart speakers, but in this space Amazon has a clear advantage.
Apple's virtual assistant is Siri, and it recently released the Home Pod wireless speaker. Amazon's virtual assistant is Alexa, and it has a line of Echo smart speakers.
The Home Pod is focused on providing a music experience, while Amazon wants you to use the Echo to control the lights in your home and to manage your daily life.
And Amazon's Echo already has a much higher household penetration than Apple's Home Pod.
"If you speak to people in the industry, they say it's a lot easier to work with Amazon, because you're dealing with a much more open ecosystem," says Mr Holden.
"It's become very easy for third parties to create apps for Alexa, [whereas] Apple has always tended to be almost defensive of its control of the iOS ecosystem."
Ms Cozza agrees. She says that Amazon has been very active in pushing Echo's usefulness in the home, in enterprise and in cars, whereas Apple has not, and has far fewer partners.
When it comes to services, Apple and Amazon's offerings differ considerably.
Amazon is primarily focused on ecommerce, but apart from devices, it also sells apps, has a cloud computing business Amazon Web Services (AWS), offers video content streaming with exclusive TV content, and is also in the online payments space.
AWS has proved to be particularly lucrative - it has seen sales jump by 49% to $6.1bn in the second quarter of 2018, and its operating profit has risen to $1.64bn, from $916m in the same period in the previous year.
Juniper estimates that the cloud computing market for software, platform and infrastructure-as-a-service will be worth over $145bn in 2020.
Amazon is the largest player in this market, with a third of the market share.
"Amazon's strength in the cloud historically has been the ability to attract an enormous variety of customers; from large corporates such as Netflix, to individuals," says Mr Holden.
"Moving forward, it will be a key player in the Internet of Things (IoT) movement, particularly given its wide-ranging AWS tools and ability to provide edge computing services."
Apart from devices, Apple is mostly focused on its Apple Music streaming service; Apple Pay contactless payments; and selling music tracks and mobile apps on the iTunes Store.
But it could potentially develop other services.
"Apple has other avenues - immersive technology in education; and think about wearables and healthcare," says Ms Cozza.
"I think still there are a lot of services and opportunities where Apple can grow."
Both Amazon and Apple are hugely successful businesses, and in fact their joint total worth could encapsulate 25 of the biggest companies in the US.
But which one has the greatest potential for long term growth?
Neil Saunders, managing director of GlobalData Retail, feels that both companies will continue to grow, but at a different pace.
"They're still really admired, but there are concerns that Apple won't be able to keep pushing their iPhone as heavily as it has done in an era where there's much more competition," he tells the BBC.
Apple's share price growth has seen a lot of stops and starts, he says. It needs another "breakthrough" product and a new mass market to sell to, or its growth will stagnate.
As for Amazon, because it is a younger company than Apple, it still doesn't have an established presence in many countries, so it has more room to grow than Apple, which already has a global customer base.
"Amazon is much more of a mass market player than Apple - with some instances you could use Amazon every day," he said.
"With Apple you would only buy one product a year. Amazon has a much bigger potential to scale up than Apple."
On the downside, both companies have grown so large that they now face the threat of regulation from a number of governments, to say nothing of additional taxation.
Still, the consensus is that Apple and Amazon's fortunes are unlikely to be dented anytime soon.
"Both companies are facing issues around regulations. There are issues about taxation, but if it comes down to a straight fight between Amazon and Apple, then given that Amazon has these various strong strings to its bow, then ultimately my belief is that Amazon will win out," says Mr Saunders.