modern apps are incredibly complex they need to process payments send notifications and show maps and that's just the beginning building all these features from scratch would take years that's where apis and sdks come in they are the essential tools that make a favorite apps work together seamlessly let's start with apis or application programming interfaces think of them as universal translators they let different software applications talk to each other instead of building everything from scratch developers can tap into specialized services that are already battle tested and reliable most modern API use what's called rest architecture it's
a way of communicating through HTTP requests to specific URLs called endpoints the core operations are beautifully simple get fetches data from a service post creates new resources put update existing ones and delete while that removes them when we make these requests we can include specific parameters to get exactly what we need for operations I post we'll package data in the request body usually in Json format every API response comes with a status code that tells us what happened the 200s means everything went well like getting a thumbs up a 200 means okay we did it
while 2011 says great we created something new the 400s are different they're telling us something went wrong on our end maybe we made a bad request or try to access something without permission and those 500 level codes that's the server raising his hands to say hey this is on us we've got a problem over here security is very important in the API World services use API keys or o off tokens to verify who's making requests think of it like a digital ID card they also keep an eye on how many requests are being made go
over the limit and we might get cut off or see some extra charges on a bill let's see this in action with a food delivery app when we open it multiple apis work together behind the scenes first a map API kicks in show us all the restaurants nearby once we find a place that looks good the app's own API fetches the restaurant's manual ready to the order that's when a payment API steps in to handle our transaction after everything's confirmed a messaging API makes sure our delivery driver knows where to go now let's shift gears
to sdks software development kits while apis are the raw connection points between services sdks are like pre-built toolboxes that make those connection easier to use they handle the complex technical details so we can focus on building features and SDK is a complete package it comes with tools libraries and documentation everything we need to build apps with specific platforms like Android or iOS a well-designed SDK takes all those platform complexities and simplifies them making sure our apps behaves consistently across different devices many sdks come with pre-built API clients that make integration easy these clients handle all
the technical heavy lifting they manage authentication they format requests properly they turn complicated responses into Data that's easy to use in a code here's a real example Instagram's SDK instead writing hundreds of lines of code to connect with Instagram's API the SD K let us add a share to Instagram feature with minimal effort it's like they're saying don't worry about the technical details here's the simple way to do it so when should we choose between an API and SDK let's break it down direct API integration makes sense when we need complete control over our project
is a good choice when we want to keep our dependencies minimal and sometimes we might be working with a platform that doesn't have an SDK that's when apis become a best friend SDK take a different approach they are fantastic when we need to move fast and get our product to Market quickly they come pack with best practices built right in saving us from common pitfalls and if we need special features for specific platforms sdks are often the way to go remember it's not always an either or Choice many successful apps use both SD cases for
their main use cases and direct API access for custom features together these tools form the building blocks of mod modern software development letting us create powerful apps without Reinventing the wheel if you like our videos you might like a system design newsletter as well it covers topics and Trends in large scale system design trusted by 1 million readers subscribe that blog. bio.com