Renaming table within transaction and keeping in-sync during swap

I understand that MemSQL allows online alter table statements. But, in situations where the best course of action is to create a new table and swap them out, what is possible? My normal pattern for doing such a switch would involve creating triggers on the old table to insert/update the new table with any changes while an insert into occurs. Then performing a rename that should only block the write operations briefly until both the old object and the new object are renamed within a transaction. It is my understanding that triggers only exist in memSQL for timestamps. Is there any best memSQL practice for maintaining changing data while not failing write operations?

Thanks for any suggestions.

1 Like

Why do you want to swap table names? What application requirement is making you want to do this?

We just shipped 8.9 which supports updatable views. You can now have a view that points to your desired table, then prepare a new table with modified data, and ALTER the view to point to the new table. You can both read and update the data (within limits) via the view name, that can stay the same every day.