I Page 1 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015
Modern SSO using MEAN stackLessons learned from a live project
Dan Harabagiu, Head of Platform Development
Munich October 20, 2015
I Page 2 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015
AGENDA
Introduction
Technology stack
Performance tuning and results
Conclusions
I Page 3 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015
Introduction
I Page 4 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015
P7S1 Group snapshot – a leading media corporation in Europe
TV & Distribution
Digital Entertainment, Digital Commerce & Music
Content Production & Sales
• #1 commercial broadcaster2 in Germany and Austria
• Reaching 42m TV households in DACH1 region
• #1 in German TV ad market with ~44%3 market share
• 7 FTA TV channels with premier thematic channels franchise
• Growing distribution (HD) and Pay-TV business (3 channels)
• #1 Pay VOD platform4 and #1 Instream Video AdSales5
• Leading media investor in Germany with a portfolio of promising ventures
• Digital commerce business in travel, fashion, beauty, home & living
• Largest independent music label in Germany, artist management & events
• Within top 10 production and distribution groups globally
• 15 production assets targeting top TV markets worldwide
• >800 formats currently in development; global sales into >180 countries6
Broadcasting
German-speaking
Digital & Adjacent
Content Production
& Global Sales
1) DACH = Germany, Austria and Switzerland; 2) #1 by audience share in Germany (A14-49y) and Austria (A12-49y); 3) 9M 2014 according to Nielsen Media Research
4) 9M 2014 SVOD market share according to GfK; 5) Nielsen Media Rearch (w/o YouTube); 6) 9M 2014
I Page 5 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015
Who are we?
■ Central team under the CIO of ProSiebenSat.1 Media SE
■ Very skilled developers, software architects and IT specialists
■ Working with modern and scalable technologies
With the mission to provide central technology solutions for digital business units
in the Digital and Adjacent area.
I Page 6 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015
Who am I?
■ One of the founders of Central Technology Foundation team
■ Worked in multiple industry fields
■ Broad coverage of technologies
I Page 7 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015
SSO solution and our requirements
Single Sign-On provides the possibility of a user to be easy recognized and
authenticated across multiple web platforms and digital assets
■ Have a mature OpenID Connect implementation
■ A web service that needs to be integrated on multiple platforms
■ Web, Smart TV, Over-The-Top, mobile devices
■ A very high load to be expected
■ A minimum of 300.000 Logins / Registration per minute
■ Based on Node.js in order to handle at lower costs higher payload
I Page 8 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015
Technology Stack
I Page 9 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015
What technologies could take the challenge?
After several evaluations, we have put our bets on the MEAN stack.
■ MongoDB (Replicated and sharded structure)
■ Express (Easy framework for web services)
■ Angular (Fast and structured Frontend application)
■ Node.js (Asynchronous structure provides high load capabilities)
I Page 10 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015
The resulting landscape
I Page 11 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015
Transforming ideas into reality
■ Developed within 8 months
■ Team of 4 developers
■ Complete OpenID Connect implementation in JavaScript
■ Used Scrum methodology
■ Complete Continuous Integration process
I Page 12 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015
Performance tuning and results
I Page 13 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015
Pushing the limits once done
■ Testing was required once development reached a finite goal
■ What have we done?
■ Client simulator
■ Automated deployment
■ Aggregated metrics centrally
I Page 14 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015
Benchmarking Round 1
Environment
■ Regular MongoDB cluster (3 x 3 x 3)
■ 16 instances of Node.js application
server
■ Allowed ELB to gracefully scale over
time (10 – 15 minutes)
Results
■ 150,000 requests / minute
■ Avg response time – 220 ms0
100
200
300
400
500
600
Round1
Th
ou
sa
nd
s
Requests/minute
Handled Perf. goal
I Page 15 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015
Findings and solutions
Findings
■ Scatter gather
Solutions
■ Re-factory the data model
■ Sharding the whole data model
I Page 16 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015
Benchmarking Round 2
Environment
■ Increased MongoDB deployment
■ Added 3 more shards
■ Increased IOPS on data nodes
■ Increased Node.js deployment
■ Doubled the size (to 32 servers)
Results
■ 400.000 requests / minute
■ Average response time – 300 ms
0
100
200
300
400
500
600
Round1 Round2
Th
ou
sa
nd
s
Requests/minute
Handled Perf. goal
+167%
I Page 17 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015
Findings and solutions
Findings
■ Hot Shard issue -> Sharding based on artificial strings
■ Issues with connection handling in NodeJS
Solutions
■ Presplitting
■ Shuffle the connection points to MongoS
I Page 18 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015
Final results
Environment
■ Added 2 more shards to MongoDB
■ Total of 8 Shards
■ Same large deployment of Node.js
■ Total of 32 Servers
Results
■ 520.000 requests / minute
■ Average response time – 320 ms 0
100
200
300
400
500
600
Round1 Round2 Round3
Th
ou
sa
nd
s
Requests/minute
Handled Perf. goal
+30%
I Page 19 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015
Conclusions
I Page 20 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015
Conclusions
■ We were very happy to choose MEAN stack
■ Node.js + MongoDB = Winner
■ We have reached our targeted performance
■ Register / Authenticate the whole population of Germany in less than 3
Hours
I Page 21 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015
Learnings
■ Know your data model and analyze where the stress point could be
■ Create your data model in ways to provide you flexibility in changing at later
points in time
■ Always stress test your projects to know your limits
I Page 22 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015
Thank you!Questions?
Let us connect:
Email: [email protected]
Linkedin: https://de.linkedin.com/in/danharabagiu