Why Are APIs Better Than Direct ODBC / JDBC Connections?

I had someone email me a question the other day, asking about how they should respond when someone asks them why APIs are a better choice that using a direct ODBC / JDBC database connection. Before I wrote a piece on it I wanted to tap my network of API geeks to see what other opinions might be lurking out there. My network is always a good place to start when it comes to looking for relevant, experienced answers.

I definitely agree with my network on this. Seeing an API as simply database access is a very limited understanding of what APIs are capable of. The key word being "capability" here. It is natural for developers to begin their journey with simple Create, Read, Update, and Delete (CRUD) APIs, but it really is the 101 of what APIs are capable of. As my network says, APIs aren't about the data being stored on the backend, it is about access to that data, sharing it, interactions with it, and the capabilities this data makes possible--this is why thoughtful API design is so critical to APIs having the impact we envision.

ODBC / JDBC is about connecting to data stores. It isn't about realizing message-based system interactions as James articulates. API interactions are much more than the data exhaust produced when putting these API capabilities to work. API requests, events, and streams are not simply database queries. Sure, they can possess many of the same characteristics as a database query, but this is a pretty limited, and unimaginative view of how API design shapes how desktop, web, mobile, and device applications do what they do--going well beyond what has been capable with ODBC / JDBC integrations.

Going neyond what many database-centered folks will see as just see as philosophical differences, until they actually spend time delivering modern APIs, I feel that I should discuss some of the more tangible benefits of APIs--exploring other areas where APIs go beyond what you can do with ODBC / JDBC.

  • Authentication - You have more authentication standards available for APIs.
  • Security - It is more secure to abstract away the database driving your apps.
  • Entitlements - There is more flexibility in defining who has access to which APIs.
  • Rate Limits - APIs allow for more fine grain rate limiting for access to APIs.
  • Transformations - You can more easily transform calls made to each individual API.
  • Analysis - There are more analysis opportunities available at the API layer.
  • Caching - You can improve efficiency by caching API responses using HTTP.

These are just a handful of the more tangible benefits of going API over direct ODBC / JDBC integration. APIs reflect the current web-based world we live in, and providing direct database access by applications over the web doesn't reflect this modern reality. With APIs, we have much more visibility and observability into this layer of our application, going beyond anything we've had with direct application to database integrations. The awareness that has come from this shift in how we deliver the capabilities we need in our applications has allowed us to define and deliver entirely new types of products we couldn't realize at the database connector layer.

I have over 30 years of experience as a database administrator and developer. What caught my attention between 2006 and 2010 while using web APIs wasn't just about everything listed here. It was also about bringing me out of my database silo and forcing me to be closer to the business solutions I was looking to provide on top of my databases using APIs. Forever changing how I engage with application developers and end-users, helping me be able to see entirely new ways of doing business, and establish an awareness of how business resources can be put to work--developing an awareness I never was able to establish from building applications directly on top databases.