Is it mandatory to have Datastore and the Database server installed in the same machine, or is it mandatory to install them in separate machines, this is for a multimachine deployment.
Any reference or advice on this would be much appreciated.
The ArcGIS Data Store is completely independent of your database servers (MSSQL, PostgreSQL, etc.). So it is certainly not mandatory for them to be installed on the same machine. In fact, it's best practice for them to be installed on separate machines for workload separation purposes (so the Data Store and DBMS don't have to share resources).
The ArcGIS Architecture Center can provide some good resources on how to architect your ArcGIS Enterprise deployment. https://architecture.arcgis.com/en/framework/architecture-practices/introduction.html