Service Oriented Architecture
An Application Programming Interface (API) is an approach to software architecture that allows multiple programs to exchange data with each other and use services from each other. Given the complexity of software applications today, it is almost impossible for one program to do everything and it must rely on other programs for services. Technically, all programs can run on the same computing device but it is more likely that programs will run on different computing devices connected over a network.
This architecture can be considered to be what is known as a Distributed Computing Architecture. API architectures define the kinds of function calls or requests that can be made, how to make them, the required data formats, the conventions to follow, and other aspects of the program-to-program connection. This standardisation makes it easy for programs to interact with any other program, developed in any technology, deployed on any operating system, and deployed anywhere, as long as they are on a network and adhere to the defined standards.
The API architecture is used extensively in web and mobile apps. It is not possible to bundle all application logic and data into the app, so the app is built with just the user interface logic and designed to make API calls to the server for any processing or data it needs.
APIs also come in useful when an app wants to consume specialised services that cannot be developed within the app. There are many examples of services offered to apps over APIs:
- Stock market trading or information apps need data from the stock market but cannot be expected to maintain the data themselves. The stock market, which owns the data, offers it to app developers as an API service.
- Cab rides and food delivery apps need to use location and map services to offer their products. Instead of each app building its own, they use the API services offered by a company like Google.
- Travel apps may want to provide weather information to their users when planning a work or personal trip. Since they cannot maintain this data, they will use API services offered by a company that specialises in weather data.
The list is large and growing and most web solutions are moving towards an API architecture. In some cases API services are provided free, in some cases they are provided at a fee to the app developer, making it a business in itself.