Application Programing Interface- API • An Application Programming Interface (API) • Any changes to APIs need to be informed to are used for exposing defined assets, data, or the developers using the API as it affects the services for public consumption. applications built on the APIs • An API is a way for services and products to • These days companies give controlled access communicate with each other through a to their data and services through APIs by: documented interface. ✓ Giving access to only what the company wants to provide • APIs allows companies to open up data to ✓ Giving access to only who the company chooses external third-party developers, business to make the API available partners and internal departments within ✓ Allowing the integration of some of the their company. company's function or data with other • An app developer can leverage an API with applications ease and invoke it via a web browser, mobile ✓ Subject to terms and conditions that are agreed application, or device. to. • Product catalogs, phone listings, insurance • When data is exposed via a common API, this cases, order status, and bank loan rates are a allows a single point of maintenance, security, few of the services exposed via APIs. versioning and control. In this way data can be exposed consistently across multiple devices.
Prof Muliaro Wafula Lecture Slides 2
REST API
Prof Muliaro Wafula Lecture Slides 3
Prof Muliaro Wafula Lecture Slides 4 Challenges
Prof Muliaro Wafula Lecture Slides 5
• Applications have been packaged in a monolithic fashion – that is a team of developers constructed one large application that did everything required for a business need. • Once built, that application was then deployed multiple times across a farm of application servers. • In contrast, with the microservices architectural style, developers independently build and package several smaller applications that each implement only parts of the whole application.
Prof Muliaro Wafula Lecture Slides 6
Prof Muliaro Wafula Lecture Slides 7 • Microservices is an architecture style, in which large complex software applications are composed of one or more services. • Microservice can be deployed independently of one another and are loosely coupled. • Each of these microservices focuses on completing one task only and does that one task really well. • In all cases, that one task represents a small business capability
Prof Muliaro Wafula Lecture Slides 8
• Microservices can be developed in any programming language. • They communicate with each other using language- neutral application programming interfaces (APIs) such as Representational State Transfer (REST). • Microservices also have a bounded context. They don’t need to know anything about underlying implementation or architecture of other microservices. Prof Muliaro Wafula Lecture Slides 9 Properties of Microservices Smaller ➢Microservices means no more monoliths. Monoliths are big, clunky, slow, and inefficient. We are moving away from a world with 2GB WAR files to a world populated by many services of 500MB each, containing entire applications, servers, and necessary operating system components. ➢Microservices are an exercise in integration with all interacting components being much more loosely coupled. ➢Essentially, the idea of a microservices-based system is to maintain and secure more small components instead of fewer large components. ➢You remove single points of failure and distribute those points of failure everywhere
Prof Muliaro Wafula Lecture Slides 10
• Continuous delivery and integration can still be done with monoliths. However, then you're juggling boulders, not marbles. It's much easier to recover from dropping a marble than from dropping a boulder. • The development cycles associated with DevOps lend themselves well to microservices. • You are aiming for shorter development cycles that continuously add functionality, instead of longer development cycles that build a complete holistic vision at once. This development methodology, known as Agile, is a fundamental practice responsible for the success of DevOps • Whether you choose iterative or incremental development, the combination of microservices, DevOps culture, and Agile planning enables you to quickly build out an entire infrastructure in a shorter time • Microservices are built on the notion that if you need to go faster, you just need to add more resources. By building every service to be independently scalable, you allow for interaction among components to take advantage of a pool of resources instead of single component interfaces.