my question is pretty similar to Two way syncing between on-premise SQL Server database and Azure SQL database
but i want it between my on premises mysql and AWS RDS instance.
So functional need is when i am within organization connected to local server (without internet) i will access localhost database (hosted on premises server) and from outside of organization i will access websize which is hosted on ec2 and ec2 will be connected with RDS database. so this both database needs to be in continues 2 way synchronization. i checked AWS DMS but i think it follows master db and slave db approach in which i can update RDS from on premises. what could be the solution, if it is possible with AWS DMS only than please guide me.
Your question covers a very complex subject with many issues that need to be considered before deciding on a solution. Factors such as the amount of data changing per interval of time, network connection bandwidth and latency, network connection reliability, data security, authentication, authorization, backup and recovery procedures, fail over and fault tolerance are just the start.
This article from Amazon discusses replicating a MySQL database hosted on-premises to RDS. An interesting tidbit from this article is:
Migrate On-Premises MySQL Data to Amazon RDS