Database per application

A small change in the app key check, now it is expected that there is a database per application.