SlideShare ist ein Scribd-Unternehmen logo
1 von 57
Inside
Architecture
Lanyrd's
Andrew Godwin
Web Engineer, Lanyrd
@andrewgodwin
InfoQ.com: News & Community Site
• 750,000 unique visitors/month
• Published in 4 languages (English, Chinese, Japanese and Brazilian
Portuguese)
• Post content from our QCon conferences
• News 15-20 / week
• Articles 3-4 / week
• Presentations (videos) 12-15 / week
• Interviews 2-3 / week
• Books 1 / month
Watch the video with slide
synchronization on InfoQ.com!
http://www.infoq.com/presentations
/lanyrd-architecture
Presented at QCon London
www.qconlondon.com
Purpose of QCon
- to empower software development by facilitating the spread of
knowledge and innovation
Strategy
- practitioner-driven conference designed for YOU: influencers of
change and innovation in your teams
- speakers and topics driving the evolution and innovation
- connecting and catalyzing the influencers and innovators
Highlights
- attended by more than 12,000 delegates since 2007
- held in 9 cities worldwide
WHO AM I?
Andrew Godwin
Web developer
Systems administrator
Technical architect
Django core developer
LANYRD: THE EARLY YEARS
The Origin Story
LANYRD: THE EARLY YEARS
2010 2011 2012 2013
June 2010
LANYRD: THE EARLY YEARS
2010 2011 2012 2013
August 2010
Good music on, an orange juice and some
CSS fun in front of me, we have an apartment
in Casablanca! (for a week or two anyway :)
” ”
@natbat
7:19 pm, 18 August 2010
LANYRD: THE EARLY YEARS
2010 2011 2012 2013
August 2010
We launched lanyrd.com/ ! Go easy on it,
the log files are going a bit nuts,
who knew Twitter was viral?
” ”
@simonw
10:52 am, 31 August 2010
LANYRD: THE EARLY YEARS
2010 2011 2012 2013
August 2010
Right... this clearly isn't sustainable. Going to
have to switch the site in to read only mode
for a few hours, sorry everyone!
” ”
@simonw
11:35 am, 31 August 2010
LANYRD: THE EARLY YEARS
2010 2011 2012 2013
January 2011
Natalie and Simon start three months of
YCombinator, in California.
LANYRD: THE EARLY YEARS
2010 2011 2012 2013
September 2011
Lanyrd closes a $1.4 million seed funding
round, moves back to London.
LANYRD TODAY
2010 2011 2012 2013
March 2013
∙ Conferences
∙ Profile pages
∙ Emails
∙ Coverage
∙ Topics
∙ Guides
∙ Mobile app∙ Dashboard
LANYRD TODAY
2010 2011 2012 2013
March 2013
LANYRD TODAY
2010 2011 2012 2013
March 2013
LANYRD TODAY
2010 2011 2012 2013
March 2013
LANYRD TODAY
2010 2011 2012 2013
March 2013
LANYRD TODAY
2010 2011 2012 2013
March 2013
LANYRD TODAY
2010 2011 2012 2013
March 2013
Key dynamic parts:
Users tracking/attending events
Users tracking each other
Users tracking topics and guides
THE STACK TODAY
What we run on
THE STACK TODAY
Browser
Nginx
HAProxy
Varnish
Gunicorn
Main site runtime
Amazon S3
Celery
Task workers
Redis
PostgreSQL Solr
SSL Termination
Web Cache
Load balancer
Static files & uploads
Tasks, Set calcs
Search and facetingMain data store
Memcached
Fragment caching
THE STACK TODAY
Lanyrd is almost entirely Django (Python)
Background tasks use Celery, a Django task queue
Management tasks/cron jobs also run inside the framework
The Django application is served by Gunicorn containers
THE STACK TODAY
Main data store for everything except uploads
We run a master and a replicated slave
Around 80GB of data in five databases
Each server runs on a RAID 1 disk array
PostgreSQL
THE STACK TODAY
Task queue transport for Celery and tweet listeners
Contains user sets for every conference, user and topic
Used for efficient narrowing of queries before Solr is hit
Redis
THE STACK TODAY
Stores conferences, users, sessions and more
Very rich metadata on each item
Heavy use of sharding thoroughout the site
Solr
We run a master and a replicated slave
THE STACK TODAY
First point of call for all requests
Caches most anonymous requests
Enforces read-only mode if enabled
Varnish
One used and one hot spare at all times
THE STACK TODAY
Sits behind Varnish
Distributes load amongst frontend servers
Re-routes requests during deploys
HAProxy
Two in use at all times, identically configured
THE STACK TODAY
Stores all uploaded files from users
Upload forms post directly to S3
Serves all static assets for the site (images, CSS, JS)
S3
Static assets are versioned with hash to help cache break
THE STACK TODAY
Browser
Nginx
HAProxy
Varnish
Gunicorn
Main site runtime
Amazon S3
Celery
Task workers
Redis
PostgreSQL Solr
SSL Termination
Web Cache
Load balancer
Static files & uploads
Tasks, Set calcs
Search and facetingMain data store
Memcached
Fragment caching
THE STACK BEFORE
What we've eliminated
THE STACK BEFORE
Stored analytics, logs and some other data
Lack of schema meant some bad data persisted
Poor complex query performance
MongoDB
Useful for quick prototyping
THE STACK BEFORE
Primary data store for things not in MongoDB
Very poor complex query performance
No advanced field types
MySQL
Full database locks during schema changes
A TALE OF TWO DBS
The Great Move of 2012
A TALE OF TWO DBS
Amazon EC2
MySQL
Softlayer
PostgreSQL
A TALE OF TWO DBS
Why?
Predictable loading means EC2 unnecessary
Better I/O throughput
Both moves required database downtime
A TALE OF TWO DBS
How?
Replicate Solr and Redis across to new servers
Enter read-only mode
Dump MySQL data
Convert MySQL dump into PostgreSQL dump
Load PostgreSQL dump
Re-point DNS, proxy requests from old servers
Exit read-only mode
A TALE OF TWO DBS
Time in read-only mode: 1 ½ hours
Downtime: 0 hours
CONTENT IS KING
The Advantages of Content
CONTENT IS KING
Read-only mode is entirely viable
An hour or two at most
Everyone logged out
Varnish blocks POSTs, caches everything aggressively
CONTENT IS KING
Indexing delay is acceptable
Most site views are driven by Solr
1 or 2 minute indexing delay
Some views add in recent changes directly
FEATURE FLAGS
Always be deploying
FEATURE FLAGS
Continuous Deployment
We deploy at least 5 times a day, if not 20
Nearly all code goes into master or short-lived branches
Anything unreleased is feature flagged
FEATURE FLAGS
Feature flags
Simple named boolean toggles
Settable by user, user tag, or conference
Can change templates, view code, URLs, etc.
FEATURE FLAGS
Flag management
User tag management
WHO WROTE THAT? OH, ME
Legacy code & decisions
WHO WROTE THAT? OH, ME
Technical Debt
It's fine to have some - it can speed things up
A good chunk of ours is gone, some remains
Big schema changes get harder and harder
SMALL AND NIMBLE
The power of small teams
SMALL AND NIMBLE
Six people
SMALL AND NIMBLE
Six people
2.5
Back-end
developers
1.75
Front-end
developers
1.5
Designers
0.75
System
administrators
0.75
Business
operations
0.5
Mobile
developers
SMALL AND NIMBLE
Awareness
Everyone knows everything that's happening
Daily stand-ups
Weekly show-and-tell sessions
SMALL AND NIMBLE
Always deployable
Master branch always shippable
Large development behind feature flags
Code review for nastier changes
LESSONS LEARNED
What's important here?
LESSONS LEARNED
Small and nimble
Continuous deployment and development style allows
easy project changing
No long approval processes
Less than ½ hour from report to shipped fix
LESSONS LEARNED
Content is great
Read-only mode allows less painful downtimes
Heavy caching smooths out our load
Learnable load patterns
LESSONS LEARNED
Fix it while you can
The bigger you get, the harder a fix
We moved to PostgreSQL just in time
Big schema changes now take days of coding
LESSONS LEARNED
Six amazing people
You don't need a big team to write a complex product
Communication is absolutely key
Using Open Source well is also crucial
Thank you.
Andrew Godwin
Sponsor or promote your company using events?
Get in touch:
@andrewgodwin
http://aeracode.org
info@lanyrd.com

Weitere ähnliche Inhalte

Andere mochten auch

Develop with docker 2014 aug
Develop with docker 2014 augDevelop with docker 2014 aug
Develop with docker 2014 augVincent De Smet
 
Running Django on Docker: a workflow and code
Running Django on Docker: a workflow and codeRunning Django on Docker: a workflow and code
Running Django on Docker: a workflow and codeDanielle Madeley
 
PyCon India 2012: Celery Talk
PyCon India 2012: Celery TalkPyCon India 2012: Celery Talk
PyCon India 2012: Celery TalkPiyush Kumar
 
Jumpstart Django
Jumpstart DjangoJumpstart Django
Jumpstart Djangoryates
 
Deploying Django with Ansible
Deploying Django with AnsibleDeploying Django with Ansible
Deploying Django with Ansibleandrewmirskynet
 
Что отличает джуниора от сениора или как питонисту не иметь проблем с поиском...
Что отличает джуниора от сениора или как питонисту не иметь проблем с поиском...Что отличает джуниора от сениора или как питонисту не иметь проблем с поиском...
Что отличает джуниора от сениора или как питонисту не иметь проблем с поиском...Mail.ru Group
 
Использование Python для построения сетевых моделей, Алексей Лобозов, ГК «Про...
Использование Python для построения сетевых моделей, Алексей Лобозов, ГК «Про...Использование Python для построения сетевых моделей, Алексей Лобозов, ГК «Про...
Использование Python для построения сетевых моделей, Алексей Лобозов, ГК «Про...Mail.ru Group
 
Особенности работы backend для мобильных приложений или Python Django UWSGI в...
Особенности работы backend для мобильных приложений или Python Django UWSGI в...Особенности работы backend для мобильных приложений или Python Django UWSGI в...
Особенности работы backend для мобильных приложений или Python Django UWSGI в...Mail.ru Group
 
An Introduction to Celery
An Introduction to CeleryAn Introduction to Celery
An Introduction to CeleryIdan Gazit
 
Building Secure Twitter Apps
Building Secure Twitter AppsBuilding Secure Twitter Apps
Building Secure Twitter AppsDamon Cortesi
 
Efficient Django
Efficient DjangoEfficient Django
Efficient DjangoDavid Arcos
 
AWS Elastic Beanstalk and Docker
AWS Elastic Beanstalk and DockerAWS Elastic Beanstalk and Docker
AWS Elastic Beanstalk and DockerDocker, Inc.
 
DjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling DisqusDjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling Disquszeeg
 

Andere mochten auch (14)

Develop with docker 2014 aug
Develop with docker 2014 augDevelop with docker 2014 aug
Develop with docker 2014 aug
 
Running Django on Docker: a workflow and code
Running Django on Docker: a workflow and codeRunning Django on Docker: a workflow and code
Running Django on Docker: a workflow and code
 
PyCon India 2012: Celery Talk
PyCon India 2012: Celery TalkPyCon India 2012: Celery Talk
PyCon India 2012: Celery Talk
 
Django and Docker
Django and DockerDjango and Docker
Django and Docker
 
Jumpstart Django
Jumpstart DjangoJumpstart Django
Jumpstart Django
 
Deploying Django with Ansible
Deploying Django with AnsibleDeploying Django with Ansible
Deploying Django with Ansible
 
Что отличает джуниора от сениора или как питонисту не иметь проблем с поиском...
Что отличает джуниора от сениора или как питонисту не иметь проблем с поиском...Что отличает джуниора от сениора или как питонисту не иметь проблем с поиском...
Что отличает джуниора от сениора или как питонисту не иметь проблем с поиском...
 
Использование Python для построения сетевых моделей, Алексей Лобозов, ГК «Про...
Использование Python для построения сетевых моделей, Алексей Лобозов, ГК «Про...Использование Python для построения сетевых моделей, Алексей Лобозов, ГК «Про...
Использование Python для построения сетевых моделей, Алексей Лобозов, ГК «Про...
 
Особенности работы backend для мобильных приложений или Python Django UWSGI в...
Особенности работы backend для мобильных приложений или Python Django UWSGI в...Особенности работы backend для мобильных приложений или Python Django UWSGI в...
Особенности работы backend для мобильных приложений или Python Django UWSGI в...
 
An Introduction to Celery
An Introduction to CeleryAn Introduction to Celery
An Introduction to Celery
 
Building Secure Twitter Apps
Building Secure Twitter AppsBuilding Secure Twitter Apps
Building Secure Twitter Apps
 
Efficient Django
Efficient DjangoEfficient Django
Efficient Django
 
AWS Elastic Beanstalk and Docker
AWS Elastic Beanstalk and DockerAWS Elastic Beanstalk and Docker
AWS Elastic Beanstalk and Docker
 
DjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling DisqusDjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling Disqus
 

Mehr von C4Media

Streaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoStreaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoC4Media
 
Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileC4Media
 
Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020C4Media
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsC4Media
 
Kafka Needs No Keeper
Kafka Needs No KeeperKafka Needs No Keeper
Kafka Needs No KeeperC4Media
 
High Performing Teams Act Like Owners
High Performing Teams Act Like OwnersHigh Performing Teams Act Like Owners
High Performing Teams Act Like OwnersC4Media
 
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaDoes Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaC4Media
 
Service Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideService Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideC4Media
 
Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDC4Media
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine LearningC4Media
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at SpeedC4Media
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsC4Media
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsC4Media
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerC4Media
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleC4Media
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeC4Media
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereC4Media
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing ForC4Media
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data EngineeringC4Media
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreC4Media
 

Mehr von C4Media (20)

Streaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoStreaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live Video
 
Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy Mobile
 
Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java Applications
 
Kafka Needs No Keeper
Kafka Needs No KeeperKafka Needs No Keeper
Kafka Needs No Keeper
 
High Performing Teams Act Like Owners
High Performing Teams Act Like OwnersHigh Performing Teams Act Like Owners
High Performing Teams Act Like Owners
 
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaDoes Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
 
Service Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideService Meshes- The Ultimate Guide
Service Meshes- The Ultimate Guide
 
Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CD
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine Learning
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at Speed
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep Systems
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.js
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly Compiler
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix Scale
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's Edge
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home Everywhere
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing For
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data Engineering
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
 

Kürzlich hochgeladen

So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 

Kürzlich hochgeladen (20)

So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 

Inside Lanyrd's Architecture

  • 2. InfoQ.com: News & Community Site • 750,000 unique visitors/month • Published in 4 languages (English, Chinese, Japanese and Brazilian Portuguese) • Post content from our QCon conferences • News 15-20 / week • Articles 3-4 / week • Presentations (videos) 12-15 / week • Interviews 2-3 / week • Books 1 / month Watch the video with slide synchronization on InfoQ.com! http://www.infoq.com/presentations /lanyrd-architecture
  • 3. Presented at QCon London www.qconlondon.com Purpose of QCon - to empower software development by facilitating the spread of knowledge and innovation Strategy - practitioner-driven conference designed for YOU: influencers of change and innovation in your teams - speakers and topics driving the evolution and innovation - connecting and catalyzing the influencers and innovators Highlights - attended by more than 12,000 delegates since 2007 - held in 9 cities worldwide
  • 4. WHO AM I? Andrew Godwin Web developer Systems administrator Technical architect Django core developer
  • 5.
  • 6. LANYRD: THE EARLY YEARS The Origin Story
  • 7. LANYRD: THE EARLY YEARS 2010 2011 2012 2013 June 2010
  • 8. LANYRD: THE EARLY YEARS 2010 2011 2012 2013 August 2010 Good music on, an orange juice and some CSS fun in front of me, we have an apartment in Casablanca! (for a week or two anyway :) ” ” @natbat 7:19 pm, 18 August 2010
  • 9. LANYRD: THE EARLY YEARS 2010 2011 2012 2013 August 2010 We launched lanyrd.com/ ! Go easy on it, the log files are going a bit nuts, who knew Twitter was viral? ” ” @simonw 10:52 am, 31 August 2010
  • 10. LANYRD: THE EARLY YEARS 2010 2011 2012 2013 August 2010 Right... this clearly isn't sustainable. Going to have to switch the site in to read only mode for a few hours, sorry everyone! ” ” @simonw 11:35 am, 31 August 2010
  • 11. LANYRD: THE EARLY YEARS 2010 2011 2012 2013 January 2011 Natalie and Simon start three months of YCombinator, in California.
  • 12. LANYRD: THE EARLY YEARS 2010 2011 2012 2013 September 2011 Lanyrd closes a $1.4 million seed funding round, moves back to London.
  • 13. LANYRD TODAY 2010 2011 2012 2013 March 2013 ∙ Conferences ∙ Profile pages ∙ Emails ∙ Coverage ∙ Topics ∙ Guides ∙ Mobile app∙ Dashboard
  • 14. LANYRD TODAY 2010 2011 2012 2013 March 2013
  • 15. LANYRD TODAY 2010 2011 2012 2013 March 2013
  • 16. LANYRD TODAY 2010 2011 2012 2013 March 2013
  • 17. LANYRD TODAY 2010 2011 2012 2013 March 2013
  • 18. LANYRD TODAY 2010 2011 2012 2013 March 2013
  • 19. LANYRD TODAY 2010 2011 2012 2013 March 2013 Key dynamic parts: Users tracking/attending events Users tracking each other Users tracking topics and guides
  • 20. THE STACK TODAY What we run on
  • 21. THE STACK TODAY Browser Nginx HAProxy Varnish Gunicorn Main site runtime Amazon S3 Celery Task workers Redis PostgreSQL Solr SSL Termination Web Cache Load balancer Static files & uploads Tasks, Set calcs Search and facetingMain data store Memcached Fragment caching
  • 22. THE STACK TODAY Lanyrd is almost entirely Django (Python) Background tasks use Celery, a Django task queue Management tasks/cron jobs also run inside the framework The Django application is served by Gunicorn containers
  • 23. THE STACK TODAY Main data store for everything except uploads We run a master and a replicated slave Around 80GB of data in five databases Each server runs on a RAID 1 disk array PostgreSQL
  • 24. THE STACK TODAY Task queue transport for Celery and tweet listeners Contains user sets for every conference, user and topic Used for efficient narrowing of queries before Solr is hit Redis
  • 25. THE STACK TODAY Stores conferences, users, sessions and more Very rich metadata on each item Heavy use of sharding thoroughout the site Solr We run a master and a replicated slave
  • 26. THE STACK TODAY First point of call for all requests Caches most anonymous requests Enforces read-only mode if enabled Varnish One used and one hot spare at all times
  • 27. THE STACK TODAY Sits behind Varnish Distributes load amongst frontend servers Re-routes requests during deploys HAProxy Two in use at all times, identically configured
  • 28. THE STACK TODAY Stores all uploaded files from users Upload forms post directly to S3 Serves all static assets for the site (images, CSS, JS) S3 Static assets are versioned with hash to help cache break
  • 29. THE STACK TODAY Browser Nginx HAProxy Varnish Gunicorn Main site runtime Amazon S3 Celery Task workers Redis PostgreSQL Solr SSL Termination Web Cache Load balancer Static files & uploads Tasks, Set calcs Search and facetingMain data store Memcached Fragment caching
  • 30. THE STACK BEFORE What we've eliminated
  • 31. THE STACK BEFORE Stored analytics, logs and some other data Lack of schema meant some bad data persisted Poor complex query performance MongoDB Useful for quick prototyping
  • 32. THE STACK BEFORE Primary data store for things not in MongoDB Very poor complex query performance No advanced field types MySQL Full database locks during schema changes
  • 33. A TALE OF TWO DBS The Great Move of 2012
  • 34. A TALE OF TWO DBS Amazon EC2 MySQL Softlayer PostgreSQL
  • 35. A TALE OF TWO DBS Why? Predictable loading means EC2 unnecessary Better I/O throughput Both moves required database downtime
  • 36. A TALE OF TWO DBS How? Replicate Solr and Redis across to new servers Enter read-only mode Dump MySQL data Convert MySQL dump into PostgreSQL dump Load PostgreSQL dump Re-point DNS, proxy requests from old servers Exit read-only mode
  • 37. A TALE OF TWO DBS Time in read-only mode: 1 ½ hours Downtime: 0 hours
  • 38. CONTENT IS KING The Advantages of Content
  • 39. CONTENT IS KING Read-only mode is entirely viable An hour or two at most Everyone logged out Varnish blocks POSTs, caches everything aggressively
  • 40. CONTENT IS KING Indexing delay is acceptable Most site views are driven by Solr 1 or 2 minute indexing delay Some views add in recent changes directly
  • 42. FEATURE FLAGS Continuous Deployment We deploy at least 5 times a day, if not 20 Nearly all code goes into master or short-lived branches Anything unreleased is feature flagged
  • 43. FEATURE FLAGS Feature flags Simple named boolean toggles Settable by user, user tag, or conference Can change templates, view code, URLs, etc.
  • 45. WHO WROTE THAT? OH, ME Legacy code & decisions
  • 46. WHO WROTE THAT? OH, ME Technical Debt It's fine to have some - it can speed things up A good chunk of ours is gone, some remains Big schema changes get harder and harder
  • 47. SMALL AND NIMBLE The power of small teams
  • 49. SMALL AND NIMBLE Six people 2.5 Back-end developers 1.75 Front-end developers 1.5 Designers 0.75 System administrators 0.75 Business operations 0.5 Mobile developers
  • 50. SMALL AND NIMBLE Awareness Everyone knows everything that's happening Daily stand-ups Weekly show-and-tell sessions
  • 51. SMALL AND NIMBLE Always deployable Master branch always shippable Large development behind feature flags Code review for nastier changes
  • 53. LESSONS LEARNED Small and nimble Continuous deployment and development style allows easy project changing No long approval processes Less than ½ hour from report to shipped fix
  • 54. LESSONS LEARNED Content is great Read-only mode allows less painful downtimes Heavy caching smooths out our load Learnable load patterns
  • 55. LESSONS LEARNED Fix it while you can The bigger you get, the harder a fix We moved to PostgreSQL just in time Big schema changes now take days of coding
  • 56. LESSONS LEARNED Six amazing people You don't need a big team to write a complex product Communication is absolutely key Using Open Source well is also crucial
  • 57. Thank you. Andrew Godwin Sponsor or promote your company using events? Get in touch: @andrewgodwin http://aeracode.org info@lanyrd.com