Would it be possible to have a API for another database with its own topics, posts, search and integrate that into Discourse so I can use Discourse as a front end and that as an backend?
No.
Think about import your data.
Is it possible to import 500gb+? Or is there a size limit
No, there is no size limit.