Joel.Watson92@gmail.com | LinkedIn: /in/joel3rbear | Twitter: @Joel3rBear
Interfaces are useful because they simplify how you interact with something (like a database) and they can also simplify how the data is returned.
Middleware is called middleware because it happens in the middle of the opperation. For instance you can use middleware to authenticate a user before preforming the command.
To have a mock of something is to create a fake instance of that thing in order to interact with it when you are testing. It is useful when you are testing against a database or an API so you dont need to keep connecting or wasting api credits.
Having a mock database means that you create a database with the same structure as your real database but unlike your real database, it only exists for the lifetime of the test