SlideShare uma empresa Scribd logo
1 de 44
Baixar para ler offline
Illustrated App Development
Ben Marx Lead Engineer
@bgmarx
STATS
• 15	million	app	downloads	
• 1.5	billion	global	page	views	per	month	
• 16	billion	global	page	views	in	the	last	year	
• 250,000	concurrent	users	at	peak	
• The	Lebron	“Decision”	
• NFL	Dra>	
• Unexpected	breaking	news	
• Over	3	billion	push	noAficaAons	per	month
2nd largest sports platform
Technical debt
• 8	years	
• Started	Rails	1.x	
• Monolith	
• Web	first		
• Lost	domain	knowledge	
• Shi>ing	trends
Reasons for exploring
alternatives to Ruby and Rails
Initial Considerations
• Breaking	News,	NoAficaAons	
• Be	the	fastest	
• Not	Ruby’s	strength	
• Caching,	server	costs	
• Customizable	
• On-the-fly	content	delivery	
• No	or	limited	caching	
• Fantasy	players
Business requirements to
meet when choosing a new
language
Why elixir
• New	language	
• Driven	by	respected	developers	and	
contributors	
• Except	for	Erlang,	the	BEAM	
• MulA-core	world	
• Can	always	fall	back	to	Erlang	if	necessary	
• Familiar	Syntax	
• Ruby	is	comfortable	
• Erlang	is	unique
From a number of options,
Elixir was chosen
App LifeCycle
APP LIFECYCLE
• Product	Requirements	
• IniAal	Development	
• Features	
• Release	
• Refactor	
• Features
The common lifecycle patterns
of most applications
App lifecycle
The common lifecycle patterns
of most applications
Exploratory Defini/on Release	-	1.0 Features Refactor Features
ADDITIONS
DELETIONS
Exploratory
Exploratory
• Initial Commit October 2014
• Rails-y
• Simple data model
• Stream has many items
• Deploy
• Docker
• Elastic Beanstalk
Product definition
Product Definition
• Initial success
• Developer approval
• Second Elixir app
• Monolith
• Lost domain knowledge
• Ecto Changesets
def update_item_from_map(item_map) do
item = from_map(item_map)
Repo.update(item)
item
end
RElease
RELEASE
• Stagnant
• Versions behind Phoenix
• Churn and dramatic change
• Expected from pre-1.0
• Lessons learned
• Tech debt at bay
• Refactor as integral part of
development
Release
• Migrated all streams to new
app
• Phased rollout
• Least popular to most popular
• Rollout Flags
• Performant App
RElease
• Still Object Oriented
• Model and interactors
• Still lacking library support
• New Relic
• Exometer
FEAtures
Features
• 3 Elixir apps
• No major releases
Features
• Feature development on
hold
• Big backlog
• New content types
• Difficult to validate
• Non-trivial work
REFACTOR
Refactor
• Huge undertaking
• Many moving parts
• Informed data modeling
• Stream has many items
• has one content
• has one metadata
Refactor
• Trivial to add content types
• Ecto Changesets
• Good way for new developers
to start working with Elixir
• Easy to test
def insert_changeset(model, params  :empty, content_type) do
model
|> cast_content_type(params, content_type)
|> cast(params, ~w(), @optional_fields)
end
def cast_changeset("video_article", changeset, params) do
changeset
|> cast(params, @required_article_fields, @optional_fields)
|> set_video_autoplay(params["autoplay"])
|> validate_inclusion(:hook_type, @hook_types)
|> validate_gif_hook
end
Refactor
• Standardizations
• Credo
• Excoveralls
• Inch
• Consistent code style
• More meaningful code
reviews
Features
Features
• 4 Elixir apps
• 2 in development
• NFL draft
• Barometer for company
• First major test
• Kevin Durant Free Agency
• Traffic increased 4x in minutes
Features
• Move all list blending to one
app
• Most hit endpoint in the system
• Understanding the monolith
better
• Better architectural decisions
• Leverage Fastly
Encourage iteration
Ecto Changesets
def update_track_from_map(item_map) do
item = from_map(item_map)
Repo.update(item)
item
end
def changeset(model, params  :empty) do
model
|> cast(params, @required_fields, @optional_fields)
end
Wrapped in a transaction:
def update_changeset(data, params  :invalid) do
data
|> cast(params, @required_fields, @optional_fields)
|> validate_inclusion(:content_type, @content_types)
|> validate_url(params["content_type"])
|> standardize_url
|> lock_position
|> update_position
|> unique_constraint(:position, name: :items_unique_position)
|> unique_constraint(:url, name: :items_unique_url)
|> update_url
end
Parent:
def update_changeset(data, params  %{}) do
data
|> cast(params, @fields)
|> validate_required(@required)
|> validate_length(:url, min: 4)
|> validate_inclusion(:content_type, @content_types)
|> validate_url(params["content_type"])
|> unique_constraint(:position, name: :items_unique_position)
|> unique_constraint(:url, name: :items_unique_url)
|> status
|> cast_assoc(:content, required: true, with: &App.Content.update_changeset(&1, &2,
params["content_type"]))
end
Child:
def update_changeset(data, params  %{}, content_type) do
data
|> cast(params, @fields)
|> cast_content_type(params, content_type)
|> cast_assoc(:metadata, required: true, with: &App.AssociatedData.update_changeset(&1, &2,
content_type))
end
Bulk ACtions
streams
|> Enum.map(&Task.async(__MODULE__, :create, [item_hashes, &1]))
|> Enum.map(&Task.await(&1)
|> List.flatten
Stream.filter(item_hashes, &(&1["url"] != nil))
|> Enum.uniq(&(&1["url"]))
|> Stream.map(&Task.async(Track, :fetch_embed,[&1, skip_embed]))
|> Enum.map(&Task.await(&1, 30_000))
|> Enum.map(&hash_to_track/1)
|> Enum.filter(&(&1.embed["errors"] == nil ))
|> Enum.map(&create_track(&1, Stream.find_or_create(stream)))
Enum.map(Enum.chunk(streams, chunk_size, chunk_size, []), (
fn chunk ->
Task.async(
fn ->
Enum.map(chunk,
fn stream ->
create_tracks(stream, item_params)
end)
end)
end))
|> Enum.map(&Task.await(&1))
|> List.flatten
Elixir at Br
Elixir at br
• 6	Elixir	apps	
• 3	more	in	development	
• New	consumer	facing	apps	are	Elixir	
• Happy	stakeholders	
• Tangible	benefits	
• Server	costs	
• Third	party	integraAons
So where do we go from here?
Elixir at br • All	backend	developers	write	Elixir	
• Some	frontend,	too	
• Happy	and	producLve	
• Quickly	wriAng	producAon	ready	
code	
• Open	source	
• Dev	blog	@	dev.bleacherreport.com
So where do we go from here?
Questions
Ben Marx
@bgmarx
bmarx@bleacherreport.com

Mais conteúdo relacionado

Mais procurados

You Were Lied To About Optimization
You Were Lied To About OptimizationYou Were Lied To About Optimization
You Were Lied To About OptimizationChris Tankersley
 
Test Design and Automation for REST API
Test Design and Automation for REST APITest Design and Automation for REST API
Test Design and Automation for REST APIIvan Katunou
 
PHPMaker - The Best PHP Code Generator Ever !
PHPMaker - The Best PHP Code Generator Ever !PHPMaker - The Best PHP Code Generator Ever !
PHPMaker - The Best PHP Code Generator Ever !Masino Sinaga
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQLKnoldus Inc.
 
AlwaysOn Availability Group Job Management
AlwaysOn Availability Group Job ManagementAlwaysOn Availability Group Job Management
AlwaysOn Availability Group Job ManagementKen Wilson
 
Alfresco Day Milano 2016 - Pernexas
Alfresco Day Milano 2016 - PernexasAlfresco Day Milano 2016 - Pernexas
Alfresco Day Milano 2016 - PernexasAlfresco Software
 
API Test Automation
API Test Automation API Test Automation
API Test Automation SQALab
 
API Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj RollisonAPI Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj RollisonTEST Huddle
 
BrightGen Salesforce Winter17 Release Webinar
BrightGen Salesforce Winter17 Release WebinarBrightGen Salesforce Winter17 Release Webinar
BrightGen Salesforce Winter17 Release Webinarbrightgenss
 
David Max SATURN 2018 - Migrating from Oracle to Espresso
David Max SATURN 2018 - Migrating from Oracle to EspressoDavid Max SATURN 2018 - Migrating from Oracle to Espresso
David Max SATURN 2018 - Migrating from Oracle to EspressoDavid Max
 
Alfresco Day Milano 2016 - Demo Data
Alfresco Day Milano 2016 - Demo DataAlfresco Day Milano 2016 - Demo Data
Alfresco Day Milano 2016 - Demo DataAlfresco Software
 
With the Power of Roslyn: Code Analysis
With the Power of Roslyn: Code AnalysisWith the Power of Roslyn: Code Analysis
With the Power of Roslyn: Code AnalysisGlobalLogic Ukraine
 
Onion Architecture with S#arp
Onion Architecture with S#arpOnion Architecture with S#arp
Onion Architecture with S#arpGary Pedretti
 
API Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNGAPI Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNGSiddharth Sharma
 
Siebel test automation enchancements by areon consulting
Siebel test automation enchancements by areon consultingSiebel test automation enchancements by areon consulting
Siebel test automation enchancements by areon consultingVasiliy Tokarchuk
 

Mais procurados (19)

You Were Lied To About Optimization
You Were Lied To About OptimizationYou Were Lied To About Optimization
You Were Lied To About Optimization
 
Test Design and Automation for REST API
Test Design and Automation for REST APITest Design and Automation for REST API
Test Design and Automation for REST API
 
PHPMaker - The Best PHP Code Generator Ever !
PHPMaker - The Best PHP Code Generator Ever !PHPMaker - The Best PHP Code Generator Ever !
PHPMaker - The Best PHP Code Generator Ever !
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
 
introduction v4
introduction v4introduction v4
introduction v4
 
AlwaysOn Availability Group Job Management
AlwaysOn Availability Group Job ManagementAlwaysOn Availability Group Job Management
AlwaysOn Availability Group Job Management
 
Alfresco Day Milano 2016 - Pernexas
Alfresco Day Milano 2016 - PernexasAlfresco Day Milano 2016 - Pernexas
Alfresco Day Milano 2016 - Pernexas
 
Velocity - Edge UG
Velocity - Edge UGVelocity - Edge UG
Velocity - Edge UG
 
API Test Automation
API Test Automation API Test Automation
API Test Automation
 
Slides
SlidesSlides
Slides
 
API Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj RollisonAPI Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj Rollison
 
BrightGen Salesforce Winter17 Release Webinar
BrightGen Salesforce Winter17 Release WebinarBrightGen Salesforce Winter17 Release Webinar
BrightGen Salesforce Winter17 Release Webinar
 
David Max SATURN 2018 - Migrating from Oracle to Espresso
David Max SATURN 2018 - Migrating from Oracle to EspressoDavid Max SATURN 2018 - Migrating from Oracle to Espresso
David Max SATURN 2018 - Migrating from Oracle to Espresso
 
Platforms FTW!
Platforms FTW!Platforms FTW!
Platforms FTW!
 
Alfresco Day Milano 2016 - Demo Data
Alfresco Day Milano 2016 - Demo DataAlfresco Day Milano 2016 - Demo Data
Alfresco Day Milano 2016 - Demo Data
 
With the Power of Roslyn: Code Analysis
With the Power of Roslyn: Code AnalysisWith the Power of Roslyn: Code Analysis
With the Power of Roslyn: Code Analysis
 
Onion Architecture with S#arp
Onion Architecture with S#arpOnion Architecture with S#arp
Onion Architecture with S#arp
 
API Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNGAPI Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNG
 
Siebel test automation enchancements by areon consulting
Siebel test automation enchancements by areon consultingSiebel test automation enchancements by areon consulting
Siebel test automation enchancements by areon consulting
 

Semelhante a Illustrated App Development

VA Smalltalk Update
VA Smalltalk UpdateVA Smalltalk Update
VA Smalltalk UpdateESUG
 
Cincom smalltalk roadmap 2015 draft3
Cincom smalltalk roadmap 2015 draft3Cincom smalltalk roadmap 2015 draft3
Cincom smalltalk roadmap 2015 draft3ArdenCST
 
Mainframe Virtual User Group Summer 2013
Mainframe Virtual User Group Summer 2013Mainframe Virtual User Group Summer 2013
Mainframe Virtual User Group Summer 2013Serena Software
 
Cincom Smalltalk Roadmap 2015
Cincom Smalltalk Roadmap 2015Cincom Smalltalk Roadmap 2015
Cincom Smalltalk Roadmap 2015ESUG
 
Cincom smalltalk roadmap 2015 draft2
Cincom smalltalk roadmap 2015 draft2Cincom smalltalk roadmap 2015 draft2
Cincom smalltalk roadmap 2015 draft2ArdenCST
 
Domain Specific Development using T4
Domain Specific Development using T4Domain Specific Development using T4
Domain Specific Development using T4Joubin Najmaie
 
Dev ops for mobile apps at microsoft teams
Dev ops for mobile apps at microsoft teamsDev ops for mobile apps at microsoft teams
Dev ops for mobile apps at microsoft teamsMahesh Arali
 
Software design with Domain-driven design
Software design with Domain-driven design Software design with Domain-driven design
Software design with Domain-driven design Allan Mangune
 
COMMitMDE'18: Eclipse Hawk: model repository querying as a service
COMMitMDE'18: Eclipse Hawk: model repository querying as a serviceCOMMitMDE'18: Eclipse Hawk: model repository querying as a service
COMMitMDE'18: Eclipse Hawk: model repository querying as a serviceAntonio García-Domínguez
 
MEAN Stack Warm-up
MEAN Stack Warm-upMEAN Stack Warm-up
MEAN Stack Warm-upTroy Miles
 
Sitecore at the University of Alberta
Sitecore at the University of AlbertaSitecore at the University of Alberta
Sitecore at the University of AlbertaTim Schneider
 
APIs distribuidos con alta escalabilidad
APIs distribuidos con alta escalabilidadAPIs distribuidos con alta escalabilidad
APIs distribuidos con alta escalabilidadSoftware Guru
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...Malin Weiss
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...Speedment, Inc.
 
Zero to Sixty with Oracle ApEx
Zero to Sixty with Oracle ApExZero to Sixty with Oracle ApEx
Zero to Sixty with Oracle ApExBradley Brown
 

Semelhante a Illustrated App Development (20)

VA Smalltalk Update
VA Smalltalk UpdateVA Smalltalk Update
VA Smalltalk Update
 
C#: Past, Present and Future
C#: Past, Present and FutureC#: Past, Present and Future
C#: Past, Present and Future
 
Cincom smalltalk roadmap 2015 draft3
Cincom smalltalk roadmap 2015 draft3Cincom smalltalk roadmap 2015 draft3
Cincom smalltalk roadmap 2015 draft3
 
Mainframe Virtual User Group Summer 2013
Mainframe Virtual User Group Summer 2013Mainframe Virtual User Group Summer 2013
Mainframe Virtual User Group Summer 2013
 
Cincom Smalltalk Roadmap 2015
Cincom Smalltalk Roadmap 2015Cincom Smalltalk Roadmap 2015
Cincom Smalltalk Roadmap 2015
 
Cincom smalltalk roadmap 2015 draft2
Cincom smalltalk roadmap 2015 draft2Cincom smalltalk roadmap 2015 draft2
Cincom smalltalk roadmap 2015 draft2
 
Domain Specific Development using T4
Domain Specific Development using T4Domain Specific Development using T4
Domain Specific Development using T4
 
Dev ops for mobile apps at microsoft teams
Dev ops for mobile apps at microsoft teamsDev ops for mobile apps at microsoft teams
Dev ops for mobile apps at microsoft teams
 
Software design with Domain-driven design
Software design with Domain-driven design Software design with Domain-driven design
Software design with Domain-driven design
 
COMMitMDE'18: Eclipse Hawk: model repository querying as a service
COMMitMDE'18: Eclipse Hawk: model repository querying as a serviceCOMMitMDE'18: Eclipse Hawk: model repository querying as a service
COMMitMDE'18: Eclipse Hawk: model repository querying as a service
 
Startup Showcase - QuizUp
Startup Showcase - QuizUpStartup Showcase - QuizUp
Startup Showcase - QuizUp
 
MEAN Stack Warm-up
MEAN Stack Warm-upMEAN Stack Warm-up
MEAN Stack Warm-up
 
Hyperloop
HyperloopHyperloop
Hyperloop
 
Sitecore at the University of Alberta
Sitecore at the University of AlbertaSitecore at the University of Alberta
Sitecore at the University of Alberta
 
Hyperloop
HyperloopHyperloop
Hyperloop
 
APIs distribuidos con alta escalabilidad
APIs distribuidos con alta escalabilidadAPIs distribuidos con alta escalabilidad
APIs distribuidos con alta escalabilidad
 
SGCE 2015 REST APIs
SGCE 2015 REST APIsSGCE 2015 REST APIs
SGCE 2015 REST APIs
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
 
Zero to Sixty with Oracle ApEx
Zero to Sixty with Oracle ApExZero to Sixty with Oracle ApEx
Zero to Sixty with Oracle ApEx
 

Último

The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 

Último (20)

The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 

Illustrated App Development

  • 1. Illustrated App Development Ben Marx Lead Engineer @bgmarx
  • 2. STATS • 15 million app downloads • 1.5 billion global page views per month • 16 billion global page views in the last year • 250,000 concurrent users at peak • The Lebron “Decision” • NFL Dra> • Unexpected breaking news • Over 3 billion push noAficaAons per month 2nd largest sports platform
  • 3. Technical debt • 8 years • Started Rails 1.x • Monolith • Web first • Lost domain knowledge • Shi>ing trends Reasons for exploring alternatives to Ruby and Rails
  • 4. Initial Considerations • Breaking News, NoAficaAons • Be the fastest • Not Ruby’s strength • Caching, server costs • Customizable • On-the-fly content delivery • No or limited caching • Fantasy players Business requirements to meet when choosing a new language
  • 5. Why elixir • New language • Driven by respected developers and contributors • Except for Erlang, the BEAM • MulA-core world • Can always fall back to Erlang if necessary • Familiar Syntax • Ruby is comfortable • Erlang is unique From a number of options, Elixir was chosen
  • 7. APP LIFECYCLE • Product Requirements • IniAal Development • Features • Release • Refactor • Features The common lifecycle patterns of most applications
  • 8. App lifecycle The common lifecycle patterns of most applications Exploratory Defini/on Release - 1.0 Features Refactor Features ADDITIONS DELETIONS
  • 10. Exploratory • Initial Commit October 2014 • Rails-y • Simple data model • Stream has many items • Deploy • Docker • Elastic Beanstalk
  • 11.
  • 13. Product Definition • Initial success • Developer approval • Second Elixir app • Monolith • Lost domain knowledge • Ecto Changesets
  • 14. def update_item_from_map(item_map) do item = from_map(item_map) Repo.update(item) item end
  • 16. RELEASE • Stagnant • Versions behind Phoenix • Churn and dramatic change • Expected from pre-1.0 • Lessons learned • Tech debt at bay • Refactor as integral part of development
  • 17. Release • Migrated all streams to new app • Phased rollout • Least popular to most popular • Rollout Flags • Performant App
  • 18. RElease • Still Object Oriented • Model and interactors • Still lacking library support • New Relic • Exometer
  • 20. Features • 3 Elixir apps • No major releases
  • 21. Features • Feature development on hold • Big backlog • New content types • Difficult to validate • Non-trivial work
  • 23. Refactor • Huge undertaking • Many moving parts • Informed data modeling • Stream has many items • has one content • has one metadata
  • 24. Refactor • Trivial to add content types • Ecto Changesets • Good way for new developers to start working with Elixir • Easy to test def insert_changeset(model, params :empty, content_type) do model |> cast_content_type(params, content_type) |> cast(params, ~w(), @optional_fields) end def cast_changeset("video_article", changeset, params) do changeset |> cast(params, @required_article_fields, @optional_fields) |> set_video_autoplay(params["autoplay"]) |> validate_inclusion(:hook_type, @hook_types) |> validate_gif_hook end
  • 25. Refactor • Standardizations • Credo • Excoveralls • Inch • Consistent code style • More meaningful code reviews
  • 27. Features • 4 Elixir apps • 2 in development • NFL draft • Barometer for company • First major test • Kevin Durant Free Agency • Traffic increased 4x in minutes
  • 28. Features • Move all list blending to one app • Most hit endpoint in the system • Understanding the monolith better • Better architectural decisions • Leverage Fastly
  • 29.
  • 30.
  • 33. def update_track_from_map(item_map) do item = from_map(item_map) Repo.update(item) item end
  • 34. def changeset(model, params :empty) do model |> cast(params, @required_fields, @optional_fields) end
  • 35. Wrapped in a transaction: def update_changeset(data, params :invalid) do data |> cast(params, @required_fields, @optional_fields) |> validate_inclusion(:content_type, @content_types) |> validate_url(params["content_type"]) |> standardize_url |> lock_position |> update_position |> unique_constraint(:position, name: :items_unique_position) |> unique_constraint(:url, name: :items_unique_url) |> update_url end
  • 36. Parent: def update_changeset(data, params %{}) do data |> cast(params, @fields) |> validate_required(@required) |> validate_length(:url, min: 4) |> validate_inclusion(:content_type, @content_types) |> validate_url(params["content_type"]) |> unique_constraint(:position, name: :items_unique_position) |> unique_constraint(:url, name: :items_unique_url) |> status |> cast_assoc(:content, required: true, with: &App.Content.update_changeset(&1, &2, params["content_type"])) end Child: def update_changeset(data, params %{}, content_type) do data |> cast(params, @fields) |> cast_content_type(params, content_type) |> cast_assoc(:metadata, required: true, with: &App.AssociatedData.update_changeset(&1, &2, content_type)) end
  • 38. streams |> Enum.map(&Task.async(__MODULE__, :create, [item_hashes, &1])) |> Enum.map(&Task.await(&1) |> List.flatten
  • 39. Stream.filter(item_hashes, &(&1["url"] != nil)) |> Enum.uniq(&(&1["url"])) |> Stream.map(&Task.async(Track, :fetch_embed,[&1, skip_embed])) |> Enum.map(&Task.await(&1, 30_000)) |> Enum.map(&hash_to_track/1) |> Enum.filter(&(&1.embed["errors"] == nil )) |> Enum.map(&create_track(&1, Stream.find_or_create(stream)))
  • 40. Enum.map(Enum.chunk(streams, chunk_size, chunk_size, []), ( fn chunk -> Task.async( fn -> Enum.map(chunk, fn stream -> create_tracks(stream, item_params) end) end) end)) |> Enum.map(&Task.await(&1)) |> List.flatten
  • 42. Elixir at br • 6 Elixir apps • 3 more in development • New consumer facing apps are Elixir • Happy stakeholders • Tangible benefits • Server costs • Third party integraAons So where do we go from here?
  • 43. Elixir at br • All backend developers write Elixir • Some frontend, too • Happy and producLve • Quickly wriAng producAon ready code • Open source • Dev blog @ dev.bleacherreport.com So where do we go from here?