Slide 1

Slide 1 text

The Architecture Of Marco Cecconi @sklivvz sklivvz@stackoverflow.com

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

#49 network for traffic* *source: Quantcast, Alexa

Slide 5

Slide 5 text

#49 network for traffic* …and #7 in China! *source: Quantcast, Alexa much successful very traffic 谢谢 wow

Slide 6

Slide 6 text

561,027,840 pageviews in the last 30 days* (~100% growth year over year) *source: Quantcast

Slide 7

Slide 7 text

561,027,840 pageviews in the last 30 days* (~100% growth year over year) *source: Quantcast

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

web servers load balancers redis search database http(s) http rest http protobuf sql sql protobuf tag engine

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

We are still scaling up, yo!

Slide 12

Slide 12 text

BATCAVE

Slide 13

Slide 13 text

BATCAVE DEV.SO

Slide 14

Slide 14 text

BATCAVE DEV.SO META.SO

Slide 15

Slide 15 text

BATCAVE DEV.SO META.SO

Slide 16

Slide 16 text

BATCAVE DEV.SO META.SO NETWORK

Slide 17

Slide 17 text

Move fast and break things

Slide 18

Slide 18 text

Move fast and break things* * Not the home page or question page :-)

Slide 19

Slide 19 text

Move fast and break things* * Not the home page or question page :-)

Slide 20

Slide 20 text

Network Level Caches (CDN, etc.) Server Level Cache (HttpRuntime.Cache) Site Level Cache (Redis) SQL Server Database Cache (384 gigs of RAM!) Solid State Disk

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

Too Many Allocations This is really the most basic thing that can go wrong. Too Many Pointers If you create a data structure that is a large mesh of pointers you'll have two problems. First, there will be a lot of object writes […] and, secondly, when it comes time to collect that data structure, you will make the garbage collector follow all those pointers and if necessary change them all as things move around. […] But if you create such a structure on a transitory basis, […], then you will pay the cost much more often. http://msdn.microsoft.com/en-us/library/ms973837.aspx#dotnetgcbasics_topic2

Slide 26

Slide 26 text

Too Many Allocations This is really the most basic thing that can go wrong. Too Many Pointers If you create a data structure that is a large mesh of pointers you'll have two problems. First, there will be a lot of object writes […] and, secondly, when it comes time to collect that data structure, you will make the garbage collector follow all those pointers and if necessary change them all as things move around. […] But if you create such a structure on a transitory basis, […], then you will pay the cost much more often. http://msdn.microsoft.com/en-us/library/ms973837.aspx#dotnetgcbasics_topic2

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

Too Many Allocations This is really the most basic thing that can go wrong. Too Many Pointers If you create a data structure that is a large mesh of pointers you'll have two problems. First, there will be a lot of object writes […] and, secondly, when it comes time to collect that data structure, you will make the garbage collector follow all those pointers and if necessary change them all as things move around. […] But if you create such a structure on a transitory basis, […], then you will pay the cost much more often. http://msdn.microsoft.com/en-us/library/ms973837.aspx#dotnetgcbasics_topic2

Slide 32

Slide 32 text

IRepository orderRepository = container.Resolve>(); Order order = orderRepository.Get(35); This is what you think you are doing…

Slide 33

Slide 33 text

…but if you think about it a bit more…

Slide 34

Slide 34 text

...this is what you are actually doing! IRepository repository = new ValidatingOrderRepository ( new SecurityRepository ( new LoggingRepository ( new CachingRepository ( new NHibernateRepository () ) ) ) ); Order order = repository.Get(35);

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

馄饨!

Slide 39

Slide 39 text

Few projects :-)

Slide 40

Slide 40 text

Few projects :-) Few lines of code :-)

Slide 41

Slide 41 text

Few projects :-) Few lines of code :-) Eeek! very few tests :-S

Slide 42

Slide 42 text

Few projects :-) Few lines of code :-) Awesome community to help :-D Eeek! very few tests :-S

Slide 43

Slide 43 text

YAGNI*. It works. * You Ain’t Gonna Need It!

Slide 44

Slide 44 text

* Source http://bit.ly/1eSLr8Z

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

Write libraries & open them to the world

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

DEEP DIVES

Slide 53

Slide 53 text

OPINIONATED HIRING

Slide 54

Slide 54 text

REMOTE WORK

Slide 55

Slide 55 text

• Performance is a feature • Always. Be. Shipping. • Use your circumstances. • Open source your libraries • 3 obscenely big monitors. CONCLUSION

Slide 56

Slide 56 text

$_='@mk=uf=radimdp1Z--&ewxuhhl';tr/=1m-za-l@&Z/ !a-zP@\n/&print; Marco Cecconi @sklivvz sklivvz@stackoverflow.com