veselin word camp-romania-2014
TRANSCRIPT
![Page 1: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/1.jpg)
Lessons from working on WordPress.com
WordCamp Romania 2014
![Page 2: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/2.jpg)
About me
● Veselin Nikolov● @dzver● WordPress.com
![Page 3: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/3.jpg)
About me
● Background as MS SQL DBA
● Currently trying to keep things simple in a team of 10
![Page 4: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/4.jpg)
What happened with the MySQL talk
![Page 5: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/5.jpg)
One month ago
![Page 6: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/6.jpg)
The reception
![Page 7: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/7.jpg)
The questions
● How do I make WordPress secure● What are your tips for secure WordPress● How do I chose save plugins and themes● How do you manage to work remotely?● Are there any other Bulgarians at Automattic?
![Page 8: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/8.jpg)
! MySQL
![Page 9: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/9.jpg)
There are no mistakes,only lessons.
![Page 10: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/10.jpg)
Lesson learned
● Another set of lessons this time and we'll see which one worked better :-)
![Page 11: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/11.jpg)
![Page 12: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/12.jpg)
Story #1 The ID
● 7 year old legacy code● Entire table described in the code● We have items with ids 5 and 6. We need to
add 7.
![Page 13: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/13.jpg)
Story #1 The ID
● One new object● A few helpers● 135 removed magic numbers● One changeset● 0 unit tests
● What could possibly go wrong?
![Page 14: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/14.jpg)
Story #1 Lessons
● Pleasepleaseplease, no magic numbers● Atomic commits, please!● Long functions are hard to understand● Stats monitoring● Legacy is code for which we don't have tests
![Page 15: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/15.jpg)
Story #2 The Notification
● Montreal● 1+ million emails● 1+ million discount coupons (10-ish previously)● Friday
● What could possibly go wrong?
![Page 16: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/16.jpg)
Story #2 The Notification
● Queries that work with small tables:
SELECT * FROM table
SELECT * FROM table ORDER BY whatever
LIMIT 200, 100
![Page 17: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/17.jpg)
Story #2 The Notification
● Queries that don't work with large tables:
SELECT * FROM table
SELECT * FROM table ORDER BY whatever
LIMIT 200, 100
![Page 18: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/18.jpg)
Story #2 The Notification
● Fetching big amounts of data breaks things● Offsetting breaks things● The coupons weren't really used in the past● Repeating millions of anything means a lot of
time
![Page 19: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/19.jpg)
Launching big things on Friday
![Page 20: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/20.jpg)
Offsets
SELECT * FROM ...
WHERE `id` > 1093029
ORDER BY `id` LIMIT 20
SELECT `deadline` FROM ...
WHERE `date` BETWEEN '2014-06-20' AND ...
![Page 21: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/21.jpg)
Offsets
SELECT * FROM ...
WHERE `id` > 1093029
ORDER BY `id` LIMIT 20
SELECT `deadline` FROM ...
WHERE `date` BETWEEN '2014-06-20' AND ...
![Page 22: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/22.jpg)
Offsets
SELECT * FROM `table` JOIN (
SELECT `id` FROM `table`
ORDER BY `whatever`LIMIT 5000,50
) as `b` USING `id`
![Page 23: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/23.jpg)
Story #3 The A/B Test
● A/B test is showing different things to users and measuring effect
● We use Kissmetrics
● We've had 5 different A/B testing classes
![Page 24: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/24.jpg)
Story #3 The A/B Test
● Feature-rich classes● Many levels of abstraction● Expressive names● Many filters and actions
● What could possibly go wrong?
![Page 25: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/25.jpg)
Story #3 The A/B Test
● Wrong results, no one knows why.
![Page 26: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/26.jpg)
Story #3 Lessons Learned
● KISS. Simplest solution worked● Kissmetrics rocks● A/B test everything
![Page 27: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/27.jpg)
Story #4 Barry
<bazza> howdy
<dzver> hi, did I break anything?
<bazza> your blog looks hacked
![Page 28: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/28.jpg)
Story #4
● Unique passwords● 2-factor auth● Come to WordCamp Europe and maybe watch
Barry live :-)
● #praythatbarrycomestowceurope
![Page 29: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/29.jpg)
Summary
● KISS. Simple queries. Simple code.● DRY. Repetition fails.● A/B test. Unit test. Test!
● Launch your next project on Friday at 7pm.
![Page 30: Veselin word camp-romania-2014](https://reader033.vdocuments.net/reader033/viewer/2022052822/554fb289b4c9057b298b51ba/html5/thumbnails/30.jpg)
My name is VeselinI code for food.
Ask me anything!