How to attach a database of data to a content / entity type
I would use a custom content type that stores the primary key (pk) of an instance of Foo as text, integer or whatever you need, just that one field.  Let's call the content type Bar.

Then for display create a node template for Bar that:


Queries your database by sending Bar->pk and returns the Foo row/object
Iterates through the fields in the row and displays them where and how you choose


In case you haven't already come across it, if you're intending to use an external database, it is best to define it in your settings file and call it when you need it as described here.