The whole company was fired yesterday, hahaha, waaaat?
So glad we aren’t heavily concerned with data integrity for some of our tables, otherwise this would have been ridiculous:
INSERT… ON DUPLICATE KEY UPDATE
I was doing something crazy:
INSERT INTO table (unique_key, value1, value2) VALUES ("maybe_unique", "value1", "value2"), ("maybe_unique2", "value3", "value4") ON DUPLICATE KEY UPDATE value1 = (CASE unique_key WHEN "maybe_unique" THEN "value1" WHEN "maybe_unique2" THEN "value3" ELSE value1 END), value2 = (CASE unique_key WHEN "maybe_unique" THEN "value2" WHEN "maybe_unique2" THEN "value4" ELSE value2 END)
Apparently, this can be replaced with:
INSERT INTO table (unique_key, value1, value2) VALUES ("maybe_unique", "value1", "value2"), ("maybe_unique2", "value3", "value4") ON DUPLICATE KEY UPDATE value1 = VALUES(value1), value2 = VALUES(value2)
This is a topic that deserves a serious blogger’s writing. As I haven’t spent the time to find links:
You will never know enough. Ambiguity is part of the real world. The key is recognizing what you know, getting to a point where you will probably make the right decision, and making it. Sometimes you will get unlucky.
Be less amused. Don’t let ego get in the way. Tasks are a privilege.
Rightscale load balancing. Apparently equal weight doesn’t mean equal deployment. This is a pain in the butt.
We’re trying to test out sitting multiple web servers behind a load balancer, and are using Rightscale to manage the servers. As it abstracts away your AWS interactions, all you get is a little ‘Launch’ button which lets you boot a new instance into your server array. What I’m seeing during stress testing is that the balance of the servers per availability zone directly impacts load (durp) and on stressed servers, performance.
Our stress test actually tests 3 things: The Load Balancer The Web Server The Autoscaling