The rise of cloud computing has dramatically changed the software market. Increasingly, companies are relying on a software-as-a-service model, through which customers license software on a subscription basis instead of buying a perpetual license upfront. Many small, fast-growing software firms exclusively use a software-as-a-service business model.

Despite these shifts in the software market, and despite the rapid growth of SaaS companies such as and Workday, which carry nosebleed valuations, the best way to invest in software is through the largest software companies in the world: Microsoft (NASDAQ:MSFT), Oracle (NYSE:ORCL), and International Business Machines (NYSE:IBM).

Microsoft is the largest software company in the world by far, and its dominance is the result of two products: Windows and Office. Windows runs on the vast majority of PCs, and while Chromebooks and Macs have been gaining market share, Windows remains entrenched, particularly in the enterprise space. Office is also the de facto standard, and competition from Google has done little to affect Microsoft's biggest cash cow.

With Satya Nadella having taken over as CEO of Microsoft last year, the company is taking two major initiatives in an effort to ensure that it remains the world's largest software company. First, it's investing heavily in the cloud, building out its Azure cloud computing business and increasingly offering SaaS versions of its software. Office 365, the subscription-based version of Office, became the fastest-growing business in Microsoft's history last year, and it continues to rapidly grow.

Second, Microsoft is building its software for platforms other than Windows. Office was launched for the iPad last year, and the company recently rolled out a preview version for Android, promising to be more consistent with the Office experience on other platforms compared with the existing Android Office apps. Microsoft is even building apps for the Apple Watch.

Windows is no longer the only major platform, and supporting only Windows will no longer work. To maintain its dominant market share in productivity software, Microsoft needs to put that software on the devices that people use. The company is now clearly committed to doing just that.

Similar to Microsoft, Oracle has software that's heavily entrenched in the enterprise. In the database management system market, Oracle is the undisputed leader. In 2013, Oracle's revenue share was greater than that of the four closest competitors combined.

Databases are a critical technology for enterprises, and they need to be both secure and reliable. With Oracle's databases at the heart of mission-critical applications, stripping out Oracle products in favor of an alternative comes with significant switching costs. Oracle's main advantage is simply that its database products are so ubiquitous.

Technologies such as the cloud and Big Data are bringing about significant shifts in the software industry, and Oracle will need to adapt to maintain its dominance. But the company has a huge advantage, and that buys it time, meaning Oracle doesn't need to be first to market with new technologies. For this reason, it seems likely that Oracle will continue to dominate the database business in the years ahead.

IBM is the third-largest software vendor in the world. IBM's software business is extremely profitable for the company, sporting a 31.4% pre-tax margin during the first quarter of 2015. The company mostly sells middleware, and it largely stays away from application software. During the first quarter, middleware accounted for 84% of IBM's software revenue.

IBM's strength has always been its ability to deliver integrated solutions involving hardware, software, and services, and the company is investing heavily in bringing this business model to the cloud. The company has built a cloud platform, Bluemix, through which developers have access to IBM's software delivered as a service, including its database software and analytics software such as Watson.

IBM plans to grow the percentage of revenue that it derives from software in the coming years as it invests in its strategic imperatives, which include cloud, analytics, mobile, and security. This plan should allow IBM to grow its profits at a higher rate than it grows its revenue, since software is the most profitable portion of IBM's business. While fast-growing upstart software companies may seem more exciting than the century-old IBM, the company's competitive advantages make it one of the best bets in software.