Uncovering and explaining how our digital world is changing — and changing us.

Amazon’s stock price dropped more than 3 percent in after-hours trading on Thursday after the e-commerce giant recorded a smaller second-quarter profit as expense growth outstripped revenue growth.

One reason: Amazon is spending heavily on hiring. The company saw a 51 percent increase in general and administrative costs, of which employee salaries typically make up a large amount.

Amazon of course does a ton of hiring for warehouse positions, and hopes to add 50,000 more workers through a job fair on August 2. But Amazon’s CFO called out the hiring of salespeople for both its AWS cloud computing business and advertising unit as areas where it is bringing on people at a growth rate that is faster than the 42 percent average across the entire company.

Amazon has been a pioneer in cloud computing with AWS, where its business is profitable and currently on a $16 billion annual revenue run rate. At the same time, it is facing increased competition from Microsoft and Google across the unit’s portfolio of products and the hiring ramp-up seems like one way to try to fend off these rivals and extend its lead. A recent report from the startup CB Insights showed 5,600 open job listings for the AWS unit.

On the advertising front, Amazon is still a small player compared to Google and Facebook with just 0.8 percent global market share, but the business is growing rapidly as it adds new products to steal search advertising business from Google. Amazon doesn’t yet break out its ad business but it is a big part of the sales category Amazon labels as “other” — which grew 51 percent year over year in the most recent quarter.

Sign up for the newsletter Recode Daily Email (required) By signing up, you agree to our Privacy Notice and European users agree to the data transfer policy. Subscribe