veselin word camp-romania-2014

30
Lessons from working on WordPress.com WordCamp Romania 2014

Upload: veselin-nikolov

Post on 11-May-2015

111 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: Veselin word camp-romania-2014

Lessons from working on WordPress.com

WordCamp Romania 2014

Page 2: Veselin word camp-romania-2014

About me

● Veselin Nikolov● @dzver● WordPress.com

Page 3: Veselin word camp-romania-2014

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

What happened with the MySQL talk

Page 5: Veselin word camp-romania-2014

One month ago

Page 6: Veselin word camp-romania-2014

The reception

Page 7: Veselin word camp-romania-2014

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

! MySQL

Page 9: Veselin word camp-romania-2014

There are no mistakes,only lessons.

Page 10: Veselin word camp-romania-2014

Lesson learned

● Another set of lessons this time and we'll see which one worked better :-)

Page 11: Veselin word camp-romania-2014
Page 12: Veselin word camp-romania-2014

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

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

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

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

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

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

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

Launching big things on Friday

Page 20: Veselin word camp-romania-2014

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

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

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

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

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

Story #3 The A/B Test

● Wrong results, no one knows why.

Page 26: Veselin word camp-romania-2014

Story #3 Lessons Learned

● KISS. Simplest solution worked● Kissmetrics rocks● A/B test everything

Page 27: Veselin word camp-romania-2014

Story #4 Barry

<bazza> howdy

<dzver> hi, did I break anything?

<bazza> your blog looks hacked

Page 28: Veselin word camp-romania-2014

Story #4

● Unique passwords● 2-factor auth● Come to WordCamp Europe and maybe watch

Barry live :-)

● #praythatbarrycomestowceurope

Page 29: Veselin word camp-romania-2014

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

My name is VeselinI code for food.

Ask me anything!