Micron (NASDAQ:MU) and Samsung Electronics (NASDAQOTH:SSNLF) are two of the largest memory chipmakers in the world. Micron is the third largest DRAM manufacturer and fourth largest NAND maker in the world. Samsung is the world's top manufacturer in both categories.

But Micron and Samsung have very different business models. Micron only manufactures memory chips, so it's considered a "pure play" on the cyclical demand for those components. Samsung's memory business generates less than a quarter of its total revenues. The rest comes from sales of consumer electronics, mobile devices, and displays for various devices.

Two robots battle it out.

Source: Getty Images.

Shares of Micron rallied more than 90% over the past 12 months, fueled by surging demand for memory chips across multiple markets. Samsung's OTC shares rose nearly 60% during that period, driven by the robust growth of its mobile and device solutions (components) divisions.

But after those big gains, is either tech stock worth buying at current prices? Let's compare the two companies' growth trajectories, challenges, and valuations to decide.

Which company is growing faster?

Samsung's revenue rose less than 1% in 2016, partly due to the Note 7 recall. But its sales are expected to jump 18% this year -- fueled by strong sales of new handsets like the S8 and Note 8, along with rising demand for displays and memory chips at its device solutions business. Both units posted double-digit sales growth last quarter, easily offsetting a single-digit sales decline at its consumer electronics division.

On the bottom line, Samsung's earnings are expected to rise 82% this year, compared to 19% growth last year. That improvement is mainly supported by the growth of the device solutions business, which generated 69% of Samsung's operating profits (but just 41% of its revenues) last quarter.

Micron's headquarters in Boise, Idaho.

Source: Micron.

Micron's revenue dropped 23% last year, due to the slowdown in PC sales and a glut of memory chips driving down prices. But those supplies tightened up during the second half of the year, and many device makers started reporting component shortages and spiking prices. As a result, analysts expect Micron's revenue to grow 62% this year.

On the bottom line, Micron's non-GAAP earnings plunged to a mere $0.06 last year. But the big cyclical recovery in memory prices could lift its earnings back to $4.72 per share this year.

What headwinds do Micron and Samsung face?

Samsung's brand survived the Note 7 debacle, but the recent sentencing of company heir Lee Jae-Yong over a corruption scandal could greatly reduce Samsung's popularity and clout in its home market of South Korea. Lee was sentenced to five years in prison, while four other Samsung executives received four-year sentences. However, it's believed that Lee had little to do with the day-to-day operations at Samsung Electronics, which is managed by other executives.

A more immediate threat to Samsung's growth is Apple's (NASDAQ:AAPL) new iPhones, which will be revealed later this month. The iPhone is a double-edged sword for Samsung -- robust sales strengthen its device solutions business, which supplies components for the phones, but threaten its own flagship devices. Samsung's consumer electronics business also faces cheaper competitors in the smart TV space.

Micron's growth could slow down if Samsung, SK Hynix, or other bigger rivals slash prices to gain market share, or if the PC market stalls out again. Micron also warned that state-backed tech companies in China could flood the market with cheap memory in the near future -- which could give Samsung a black eye, but break Micron's legs.

The valuations and the verdict

Samsung trades at just 11 times trailing earnings and 8 times forward earnings, which are much lower than the industry average of 19 for consumer electronics companies. Micron trades at 15 times earnings with a forward P/E of 5, which also compares favorably to the industry average P/E of 15 for memory chipmakers.

Based on these facts, I think both stocks are good investments, but they're geared toward different types of investors. Samsung is a better play for balanced, long-term growth, since it has a better diversified business with a wide moat.

Micron has more momentum, but it's not a long-term play like Samsung. Investors who don't sell Micron when the current memory cycle peaks could see their profits quickly vanish, so they need to keep a close eye on supply and demand across that market.

Leo Sun has no position in any of the stocks mentioned. The Motley Fool owns shares of and recommends Apple. The Motley Fool has a disclosure policy.