It's been a difficult year for technology stocks. The NASDAQ-100 Technology Sector Index has remained flat, and some of the biggest names in the tech space have taken hits. But Twilio (NYSE:TWLO) has bucked the trend remarkably: Shares of the cloud communications specialist have quadrupled in 2018 thanks to  outstanding growth that has surpassed expectations.

Twilio investors couldn't have imagined such a remarkable performance a year ago, when the company was down in the dumps thanks to weak customer diversification. However, the company has turned the narrative on its head, and it wouldn't be surprising to see it put in another solid performance in 2019. Here's why.

Hand drawing stock chart return.

Image Source: Getty Images

The most important catalyst

Twilio's rapidly growing customer base is, without doubt, the biggest reason behind the company's ascendancy. The company's customer count shot up 31% annually to 61,150 in the third quarter, which is almost identical to the 32% customer growth it saw in the previous quarter. But the more important thing to note here is that Twilio's top line jumped 68% year over year during the quarter, which outpaces the 41% annual revenue growth it delivered in the prior-year period.

That means Twilio customers are now spending a lot more money on its offerings. It wouldn't be surprising if the company manages to sustain this terrific pace of growth in 2019 as well, as its dollar-based net expansion rate shot up 145% during the quarter, the metric's highest growth number in nearly two years.

The dollar-based net expansion rate increases when a Twilio customer buys more solutions from the company or spends more on existing solutions. So this net expansion rate ideally goes up when a customer decides to either extend the length of their contract, expand the same to include new services, or renew the same with terms that are more favorable for Twilio.

As such, this metric can be taken as a barometer of Twilio's ability to improve business within the existing client base. The good news: The dollar-based net expansion rate is increasing quarter after quarter, along with solid increases in the number of active customer accounts.

Chart showing growth in Twilio's customer accounts and the dollar-based net expansion rate.

Data from Twilio, Chart by author.

Higher spending by Twilio customers is a result of the company's strategy of unlocking "more and more use cases within our customer base with a growing set of products." In simpler words, Twilio is finding cross-selling opportunities. The company's pursuing this strategy by adding new features to its Engagement Cloud platform and currying favor with developers so that they build communication platforms using its solutions.

That's one of the reasons why the company shelled out $2 billion on the acquisition of SendGrid, a provider of cloud-based email marketing services. This move adds another dimension to Twilio's service portfolio, while giving the company access to an established sales channel to tap another fast-growing space.

SendGrid is a fast-growing company with a sales growth forecast of 29% for this year and 25% next year. The two companies will now serve more than 100,000 customers, which means that SendGrid has at least 40,000 active customers given Twilio's latest count of just over 60,000 customers at the end of the previous quarter.

So Twilio can now cross-sell its existing products and services to these new customers. And this isn't the only benefit of the acquisition. The email marketing industry is expected to grow five-fold through 2025 compared to 2017 levels, hitting a size of over $22 billion at the end of the forecast period. Twilio is now equipped to tap this market thanks to SendGrid's rapid growth.

The path toward profitability

Twilio is also working its way toward profitability. For instance, though Twilio's R&D outlay increased 33% annually last quarter, the company spent just a quarter of its revenue on this line item. For comparison, the company spent over 31% of its revenue on R&D in the year-ago period.

The company's operating expenses increased 53% last quarter, a slower pace than the revenue increase. More specifically, Twilio's non-GAAP operating margin came in at 3% last quarter, compared to a negative figure of 8% in the prior-year period.

As a result, Twilio was able to post an adjusted net income of $0.07 per share during the third quarter, reversing the year-ago loss of $0.08 a share. What's more, the company is projecting adjusted earnings of $0.04 a share in the current quarter, up from the prior-year period's loss of $0.03 a share.

So it shouldn't be long before Twilio gets profitable on a non-GAAP basis. In fact, analysts expect the company to post a non-GAAP profit of $0.11 per share this year, compared to a loss of $0.19 a share last year. Additionally, its bottom line should get stronger in 2019, as earnings are expected to increase to $0.16 a share.

However, it wouldn't be surprising to see Twilio doing even better, because the SendGrid acquisition opens up another fast-growing opportunity for the company and improves cross-selling avenues. As such, Twilio looks all set to sustain its impressive momentum in 2019 -- its smart growth strategy should ensure solid top- and bottom-line growth in the new year.

Harsh Chauhan has no position in any of the stocks mentioned. The Motley Fool owns shares of and recommends Twilio. The Motley Fool has a disclosure policy.