I Page 1 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015
Modern SSO using MEAN stack
Lessons 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 ms
0
100
200
300
400
500
600
Round1
Thousands
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
Thousands
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
Thousands
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: dan.harabagiu@prosiebensat1.com
Linkedin: https://de.linkedin.com/in/danharabagiu

More Related Content

PDF
Modernizing statistical-production at Statistics Norway, Rune Gløersen, Jon F...
PPTX
Agile Project Management - a Coronavirus Perspective 2019
PDF
2109 apb-micas-2015
PPTX
Lean Kanban India 2015 | Implementing Scaled Kanban by Stealth: A Case Study ...
PDF
AppHub Project at ICT 2015
PDF
ImmobilienScout24 - Introduction and use of agile methods for software develo...
PPTX
A Media Utopia | ad:tech NZ 2015
PPTX
IntraTeam Event Copenhagen - What's on
Modernizing statistical-production at Statistics Norway, Rune Gløersen, Jon F...
Agile Project Management - a Coronavirus Perspective 2019
2109 apb-micas-2015
Lean Kanban India 2015 | Implementing Scaled Kanban by Stealth: A Case Study ...
AppHub Project at ICT 2015
ImmobilienScout24 - Introduction and use of agile methods for software develo...
A Media Utopia | ad:tech NZ 2015
IntraTeam Event Copenhagen - What's on

Similar to Modern SSO Using the MEAN Stack (20)

PPTX
NXP Presentation @ ThousandEyes Connect London - June 13th 2019
PDF
S1: Predix ISV Partner Program (Predix Transform 2016)
PDF
LeanIX & LoQutus: Next generation Enterprise Architecture Management
PDF
All connected, all cloud all intelligent
PPT
GNS: Your IT outsourcing provider
 
PDF
Présentation Séminaire Alfabet Décembre 2014
PDF
Continuous Improvement, make it visible - ICSPI 2006 - Ben Linders
PDF
Generali connection platform_full
PDF
Services of GNS company
PPT
Alexander Ringsdorff Magecamp 2009: The challenges, and solutions, to enterpr...
PDF
The Digital Imlementation Platform
PDF
Warehouse 4.0 today´s challenge, tomorrow´s solution
PPTX
Schnellere Digitalisierung mit einer cloudbasierten Datenstrategie
PPTX
Broadcast Music Inc. Release Rockstars: Program-Wide DevOps Success with Urba...
PPTX
Q-Rapids Project Output And Impact for Softeam
PDF
Social Collaboration und Expertensuche mit TechnoWeb (M. Langen)
PDF
Custom Software Engineering & Business Process Operations
PPTX
BMW Showcase - Celosphere 2019
PDF
App Modernization with .NET Core: How Travelers Insurance is Going Cloud-Native
NXP Presentation @ ThousandEyes Connect London - June 13th 2019
S1: Predix ISV Partner Program (Predix Transform 2016)
LeanIX & LoQutus: Next generation Enterprise Architecture Management
All connected, all cloud all intelligent
GNS: Your IT outsourcing provider
 
Présentation Séminaire Alfabet Décembre 2014
Continuous Improvement, make it visible - ICSPI 2006 - Ben Linders
Generali connection platform_full
Services of GNS company
Alexander Ringsdorff Magecamp 2009: The challenges, and solutions, to enterpr...
The Digital Imlementation Platform
Warehouse 4.0 today´s challenge, tomorrow´s solution
Schnellere Digitalisierung mit einer cloudbasierten Datenstrategie
Broadcast Music Inc. Release Rockstars: Program-Wide DevOps Success with Urba...
Q-Rapids Project Output And Impact for Softeam
Social Collaboration und Expertensuche mit TechnoWeb (M. Langen)
Custom Software Engineering & Business Process Operations
BMW Showcase - Celosphere 2019
App Modernization with .NET Core: How Travelers Insurance is Going Cloud-Native
Ad

More from MongoDB (20)

PDF
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
PDF
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
PDF
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
PDF
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
PDF
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
PDF
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
PDF
MongoDB SoCal 2020: MongoDB Atlas Jump Start
PDF
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
PDF
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
PDF
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
PDF
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
PDF
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
PDF
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
PDF
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
PDF
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
PDF
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
PDF
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
PDF
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
Ad

Recently uploaded (20)

PPTX
Module 1 Introduction to Web Programming .pptx
PPTX
SGT Report The Beast Plan and Cyberphysical Systems of Control
PDF
sbt 2.0: go big (Scala Days 2025 edition)
PPTX
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
PDF
Data Virtualization in Action: Scaling APIs and Apps with FME
PDF
Comparative analysis of machine learning models for fake news detection in so...
PDF
Accessing-Finance-in-Jordan-MENA 2024 2025.pdf
PDF
The-2025-Engineering-Revolution-AI-Quality-and-DevOps-Convergence.pdf
PDF
Convolutional neural network based encoder-decoder for efficient real-time ob...
PPTX
MuleSoft-Compete-Deck for midddleware integrations
PDF
Auditboard EB SOX Playbook 2023 edition.
PDF
Rapid Prototyping: A lecture on prototyping techniques for interface design
PDF
Lung cancer patients survival prediction using outlier detection and optimize...
PPTX
agenticai-neweraofintelligence-250529192801-1b5e6870.pptx
PPTX
future_of_ai_comprehensive_20250822032121.pptx
PPT
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
DOCX
Basics of Cloud Computing - Cloud Ecosystem
PDF
LMS bot: enhanced learning management systems for improved student learning e...
PDF
INTERSPEECH 2025 「Recent Advances and Future Directions in Voice Conversion」
PPTX
Training Program for knowledge in solar cell and solar industry
Module 1 Introduction to Web Programming .pptx
SGT Report The Beast Plan and Cyberphysical Systems of Control
sbt 2.0: go big (Scala Days 2025 edition)
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
Data Virtualization in Action: Scaling APIs and Apps with FME
Comparative analysis of machine learning models for fake news detection in so...
Accessing-Finance-in-Jordan-MENA 2024 2025.pdf
The-2025-Engineering-Revolution-AI-Quality-and-DevOps-Convergence.pdf
Convolutional neural network based encoder-decoder for efficient real-time ob...
MuleSoft-Compete-Deck for midddleware integrations
Auditboard EB SOX Playbook 2023 edition.
Rapid Prototyping: A lecture on prototyping techniques for interface design
Lung cancer patients survival prediction using outlier detection and optimize...
agenticai-neweraofintelligence-250529192801-1b5e6870.pptx
future_of_ai_comprehensive_20250822032121.pptx
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
Basics of Cloud Computing - Cloud Ecosystem
LMS bot: enhanced learning management systems for improved student learning e...
INTERSPEECH 2025 「Recent Advances and Future Directions in Voice Conversion」
Training Program for knowledge in solar cell and solar industry

Modern SSO Using the MEAN Stack

  • 1. I Page 1 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015 Modern SSO using MEAN stack Lessons learned from a live project Dan Harabagiu, Head of Platform Development Munich October 20, 2015
  • 2. I Page 2 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015 AGENDA Introduction Technology stack Performance tuning and results Conclusions
  • 3. I Page 3 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015  Introduction
  • 4. 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
  • 5. 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.
  • 6. 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
  • 7. 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
  • 8. I Page 8 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015  Technology Stack
  • 9. 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)
  • 10. I Page 10 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015 The resulting landscape
  • 11. 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
  • 12. I Page 12 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015  Performance tuning and results
  • 13. 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
  • 14. 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 ms 0 100 200 300 400 500 600 Round1 Thousands Requests/minute Handled Perf. goal
  • 15. 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
  • 16. 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 Thousands Requests/minute Handled Perf. goal +167%
  • 17. 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
  • 18. 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 Thousands Requests/minute Handled Perf. goal +30%
  • 19. I Page 19 | ProSiebenSat.1 Digital & Adjacent | Central Technology Initiatives | October 2015  Conclusions
  • 20. 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
  • 21. 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
  • 22. 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

Editor's Notes

  • #2: Hi everybody my name is Dan Harabagiu and I am Head of Platform development within ProSiebenSat.1 Digital and Adjacent Today I will have the pleasure in presenting you one of our success projects and this is as the title mentions it, Modern SSO using MEAN stack.
  • #3: What will I talk about today. Based on the agenda in front of you, I will begin with a short introduction of the company the team and the project. Will continue with describing our technology stack and architecture. After this will present our test scope and results that we acchieved and will close the presentation with conclusions that we had based on this project
  • #6: So who we are? We are a central technology team also known as Central Technology Initiatives under the holding Chief Information Officer We are a team of very skilled persons, with various technology backgrounds that wish, like and do work with modern and scalable technologies (One of wich of course is MongoDB) So What would be our mission you might ask. We were formed with the purpose of providing central technology solutions for all or any Busineess Unit under the holding umbrela. From this solutions one will be presented today and to be more exact it is a Single Sign On solution that is consumed by most of the web assets of ProSiebenSat.1
  • #8: SSO – is a web service that provides the user / consumer the possibility to easily login and be recognised on multiple web platforms and digital assets. Based on the intention of the project to unify the users of all assets and provide seamless integration across multiple domains and digital assets, we need to ensure that the service can be integrated on mutiple technology platforms as web, ott and mobile devices On top of the already dificult requirments that I‘ve told you until now, we were asked to be able to serve at least 300.000 logins or registrations per minute. After analysing our requirments we came to the conclusion that we will need a service that is based on Node.JS in order to be able to handle a higher load at a lower costs We have search for existing solutions on the market or open source. Unfotrunatly we hadn‘t find any to fulfill our requirments so we decided to buil it internally.
  • #9: So what technology we used?
  • #10: MongoDB provides a replicated and sharded structure, this in support of a system that will have a high load expected on a day to day activity Express is a framework that is on top of Node.js and it provides the developer a fast and easy way to handle web requests, views and in general web development Angular is a frontend framework that enables developers to create structured and modern web applications. We have used it to build our login / register forms, customer portals and self care. Node.JS as hopefully most of you heard of it, is a Javascript based backend technology with one of the main features being its asyncronus nature. So by this providing a high load handling capabilities compered to other „blocking“ backend technologies / languages
  • #11: So how would our landscape look like? We based our deploy on AWS infrastructure The entry point will be the Amazon ELB, which could easily scale to handle high load and supports failover The Node.JS application servers are connected to ELB and distributed accross multiple availability zones Each time a Node.JS node is started or stoped is automatically added to the ELB balancing pool. Having this in place, provided us an easy and automatic scalability and failover handling The type of instances used for nodejs are CPU intensive with stateless disks The mongoDB setup is one of the standards approach with 3 Mongos, 3 Config servers, 3 shards and each shard with 2 replicas and one arbiter (to handle voting balancing in case of failover). Also, all the mongodb servers, are distributed accross multiple availability zones for failover handling (Each replica set of the same shard is within a different AZ) The type of instances used for mongodb are memory intensive with dedicated IOPS
  • #13: So once the design and development was done, how would we test it?
  • #14: So we have built a small DDOS mechanism to be able to generate as much as load is needed from multiple locations The script was a simple behaviour driven headless browser using Node.JS. We automated most of the steps of testing cycle like: Included the script into an AMI Created a starup script to run multiple instances of our fake users once the machine has finished booting Using an internal orchestration tool we were able to spawn a fine controled amount of instances in multiple AWS regions and availability zones. We needed all the automation an granularity in order to be able to measure gradually the evolution of the system load and response time The results we measured were provided from two perspectives Internal: the time that the application needed to respond to a request External: the time that the user took to finish his action (register / login)
  • #15: So how did we tested? We prepared our infrastructure based on the layout that I described earlier with the amount of 16 Backend Nodes. We started slowly to enable load generators machine in incremental order over of a duration of 10 – 15 minutes and mainly in order to allow ELB to scale internally. After our scale up period we continued in starting load balancers until we reached either 90% cpu on nodejs or mongodb or IO load would reach 100%. In this case we stoped when the table lock and waiting of mongo started to increase the response time. So the results we had at this point were 150.000 requests / minute with an average response time from user perspecitve of 220 ms. Also would like to mention that these results are based on a sustainable runing environment, so was not peak times or peak values.
  • #16: After further investigations we have realised that the bottleneck we had in our data communications was a rather simple scatter gather that was eating most of the processing time. This was based on a collection that was having multiple unique indexes that were not part of the sharding key. So the data insertion worked pretty well, until we needed to read the data. So the solution in this case was not that simple, as we realised that we would need to change our data model. Thanks to MongoDB flexibility that was done by extractng the respective unique indexes in a dedicated collection. This increased the read spead and also increased the distribution of the data on shards, now that the data model was smaller and granular.
  • #17: So we started with the same server deployment as within the first test set and reached our previous numbers, but we wanted more. We have hit the limit on CPU and IO on data nodes, so went and increased the sharding, the disck IOPS. After this point Node.JS became a bottle neck, so we doubled the size of your infrastructure on the application nodes. We have stoped to investigate when we reached the point of adding more resources / servers will not help anymore. So we got the following results.
  • #18: - Sharding is a very good mechanism to support distribution of read and writes operations, but under initial heavy data input, unless the mongo knows where to send the data segments, everything will hit one one. So a good solution for this topic is prespliting the collections before expecting heavy traffic - Closily monitoring the connections count and load on MongoS showed us that the mongodb driver we used within our nodeJS project was not distributing evenly the connections. So we decieded to tackle on our own this issue in randomising the order of mongoS server entries within the mongodb uri
  • #19: As previously we started with our latest deployment and reached our previous values, but we still did not reached our target as the CPU of data nodes increased to almost 90%. So we increased the MongoDB clusted deployment (to total of 8 shards) and restarted the testing process. We finaly reached our target number (above 500.000) requests per minute and also hit again the CPU level on Node.JS and MongoDB data nodes. As we have reached our internal goal we decided to conclude the tests here and consider this numbers of current running limits of our platform. But if you wander yourself if the system could take more, we presume yes, but this might be a story for other times 
  • #20: So what have we concluded during this project?
  • #21: We reached out target, so pragmatically we could register or login the whole population of Germany in less then 3 hours. You should know very well your data model that you are planing to use, so you would know where to look for possible bottlenecks. Creating your data model in a way that could be extended or restructured could be a very good advantage. MongoDB provides this flexibility with ist own schemaless approach, but also the design should be flexibil. Please don‘t reflect SQL based logic and structures into a noSQL platform. It is always good to stress test your projects so you will always know your limits and have no unpleasent surprises in the future. Node.Js with its asyncronus design together with the data distribution (sharding) supported by MongoDB is a very good foundation for delivering good results, acceptable response time unde heavy traffic
  • #23: With these last thoughts I would like to tank you for listening to our story and I hope you have also learned something new from us. Thank you very much and enjoy this day.