What is Db2?
“What’s your job?” — I was asked by my friend after a tennis game.
“I’m a Db2 database administrator” — I answered immediately.
“Oh, databases. That’s interesting. But, what does it mean? What’s a Db2 database?”
I opened my mouth to answer, but I just couldn’t explain what Db2 is…
Even some experienced database administrators struggle with answering this question. Sometimes it’s easier to “feel” a technology, to just start using it and learn on the fly. This is enough to work with databases. It’s even enough to speak at Db2 conferences, where the audience also “feels” the technology. But you may still be surprised by your tennis mate.
So, what is a database?
Databases store information. You may imagine a database in the form of a cabinet, a bookcase or a simple box. You will choose different container depending on: what you want to store in there; how often you’ll put something in and take something out; how much space you have, and so on.
For example, you have books to store. you might choose a bookcase, but what if you don’t read books and You just need a storage for your unwanted birthday gifts? Then maybe simple boxes in the basement would be a cheaper option. And because the books have different formats, you will have several boxes to optimise the storage space. You know what? We have just designed our “database”! So, two conclusions here:
- depending on various factors, you will use different database architecture and technology;
- if I have described exactly your case, start reading books!
But, what is this Db2 itself?
It’s not those boxes or any other physical stuff. It’s a database manager. You may think of it as a person, who manages the boxes and the books inside. Db2 will put the books in proper boxes, retrieve the book(s) you need (if you finally start reading!) and reorganise all the books to optimise storage.
It will also tell you when the boxes become full — in such case you just need to provide it wood and nails or paper and tape (depending on how robust a database you need) and it will create new boxes if required.
Moreover, Db2 will anticipate, which books are likely to be retrieved and prepare them in a separate easy-to-access box (called ‘bufferpool’), so that you get the book you choose as fast as possible.
Also, Db2 will create copies of books if you tell it to do so. Therefore you can still read your favourite poem, even if you accidentally destroy the book.
Finally, Db2 may rearrange the storage from boxes to bookcases (if you plan to read more and you decide that the access time is more important than the storage cost). In that case Db2 will probably create an index of books to find them more quickly.
But only Db2 knows where all of the books are located. You can tell it: “Give me all Seneka books translated to Polish” and you get them fast. But no one else can find them. That’s why it’s a Db2 database. If you’re fed up with Db2 and want to replace it with Oracle (another database manager), you have to properly prepare your library for that. It’s not easy! Therefore, if you start building your library with Db2, you’ll probably stick to it.
And not all database managers are good with books. It’s a job for relational database managers like Db2, Oracle, MS SQL, MySQL, PostgreSQL etc. There are also “no-SQL” database managers that would deal greatly with storing various children’s toys, but poorly with retrieving the book title, you’re going to read today.
And there is me. A person who knows how to talk to Db2. Database managers behave so differently, that I am not even able to work with all Db2s! I can effectively deal only with Db2 for LUW (Linux/Unix/Windows) and mostly with the younger ones (Db2 technology is 40 years old and has changed significantly since its start).
So, when the next time someone asks me what Db2 is and what I really do, I’ll say: “Db2 is something that manages terabytes of records in my company and I am a person who knows how to talk to it”.


