ODBC: The Universal Translator for Databases

ODBC acts as a universal translator, letting one application speak to many different relational databases. Your app uses the standard ODBC interface, and a specific "driver" handles the unique protocol for each database. The footgun is performance overhead.
Why it exists
Before standards like ODBC, if an application needed to support three different databases, developers had to write and maintain three separate pieces of data access code. This was expensive, error-prone, and made switching databases a major engineering project. ODBC was created to solve this interoperability problem by providing a single, standard interface.
The mental model
Think of ODBC as a universal power adapter for your application. Your app (the appliance) is built with one standard plug (the ODBC API). You can connect it to any database (the wall outlet) as long as you have the right adapter (the ODBC driver). The application doesn't need to know the details of the "wiring" behind the wall; it just uses the standard interface.
How it works
An application makes calls to the ODBC interface, a set of standard functions defined in C. A component called the Driver Manager receives these calls and loads the appropriate database-specific driver. This driver is a software library that translates the standard ODBC calls into the native protocol that the target Database Management System (DBMS) understands. The driver sends the request, gets the results, and translates them back into a standard format for the application.
When to use it
Use ODBC when your primary goal is database independence. It's ideal for applications that must be deployed in various environments with unknown or changing database backends, such as a business intelligence tool that needs to connect to whatever database a customer uses. It allows an application to access diverse DBMSs through a single interface.
When not to use it
Avoid ODBC if performance is the absolute top priority and you only need to support one database. Using a database's native client library is almost always faster because it avoids the extra abstraction layer. Also, if you need to use highly specific, non-standard features of a particular database, ODBC's generic interface might get in the way.
One canonical example
Microsoft Excel can import data from external databases. When you set up a new data source, you use the ODBC Data Source Administrator to configure a connection. You select a driver (e.g., for PostgreSQL), provide connection details, and save it as a Data Source Name (DSN). Excel then uses this ODBC connection to query the database and pull data into a spreadsheet, without having any built-in knowledge of the PostgreSQL protocol.
Interview question
What is the primary mechanism by which ODBC enables an application to interact with various relational databases?
- a.Each database implements a universal ODBC interface that the application directly connects to.
- b.The application includes separate code modules for each database's native protocol.
- c.A central ODBC server translates all application requests into database-specific commands.
- d.The application uses a standard API, and a database-specific driver translates calls to the native protocol.Correct
Why? this is the answer
The card explains that an application calls the standard ODBC interface, and a database-specific driver then translates these calls into the native protocol for the target DBMS. Option B describes the problem ODBC was created to solve, not how ODBC itself functions.
Just read this? Test yourself on what you have been reading.
Read the original → learn.microsoft.com
You just looked this up. Could you explain it out loud?
That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on database — each one lists the topics its interview covers.
See open roles