Libraries vs Dependencies – What Is the Difference Between a Library and a Dependency?

dependenciesdockerlibraries

In this docker beginner video its explained, that different stacks may depend on different libraries and dependencies and that this can be handled with Docker.

However, I don't get what the difference should be between a library and a dependency. As I see it, a library is a collection of code/packages and a dependency is a library that the database/webserver/tool depends on.

So is there any difference? Or is saying "a database relies on specific libraries and dependencies" the same as "a database relies on specific libraries" ?

Best Answer

Libraries and dependencies are like persons and relatives: One is just an entity (something), the other is a relational entity.

I am a person. My niece is also a person. But to her, I'm a relative. You cannot simply be a relative by nature; you're always a relative of someone else.

Similarly, a code library becomes a dependency only when another project uses it, and then it's a dependency of that project and not of another. Even though a code library is invented specifically for other projects to use, it's not a dependency until this actually happens.

Related Topic