How about using upsert? ( Mysql way: insert into ... values (...) on duplicate key UPDATE )
Setup the unique keys on the table correctly, and upsert the data in there.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hey guys,
I am aggregating sales data for analytics and write that into another database for later visualization. So here's the thing:
I'm thinking about the concept how to insert/update that data every night. There are 2 ways in my opinion:
or
The thing is that data can change. An entry inserted yesterday may be changes tomorrow and needs to be updated/inserted again in the next cycle.
So how would you guys go for that ? Any ideas or advises ?
Thanks Marc
Please or to participate in this conversation.