We have a very huge PHP/MySQL application with a lot of legacy code, this application utilized MySQL for most of it's work. It does most of the processing on the database side using temporary tables, or tables that are used temporarily but are not strictly declared as TEMPORARY.
Also this application uses MySQL replication with 3 replicas for each instance, and we use write on those replicas.
In our current setup we use replication filtering to ignore those tables ,We are moving all of our application instances, which is about 15 deployments, to Amazon's RDS, and Amazon RDS does not allow setting "replicat-ignore-tables" param
So now we want to remove the usage of temporary tables, and we are checking the alternatives.
We mainly use them to process joined data from huge tables (billions of rows) and some matrix processing utilizing the use of indexes to process matrix rows.
What would be the best way to replace temporary tables usages using PHP and MySQL?