I am working on home automation system and I my idea was this:
There will be client app, which will be running on a classic HTTP server (on internet). It will communicate with firebase realtime (NoSQL) database. This app will also run on Raspberry Pi (Raspberry Pi will serve as local HTTP server).
Raspberry Pi will also listen to database changes and control ESP32 modules (according to entries in database). There is block diagram of my system:
My question is - is it bad idea to have a remote database (firebase database)? This home automation system is actually my bachelor thesis and commenting on my work, one professor claimed that this is a bad architecture, since the database should be on a local Raspberry Pi: no real projects use this type of architecture (database on the internet instead of local on RPi). He claimed that it is insecure and just - nobody does that. Is he right?
NOTE: Reason why I have the "internet" database is to have ability to control system via internet and not only locally... It seemed to me simplest solution for a global control feature...
So who is right? And if the professor, what is the simplest way to implement global (via internet) control? Any ideas?