SlideShare a Scribd company logo
1 of 44
Download to read 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

More Related Content

What's hot

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
 

What's hot (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
 

Similar to 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
 

Similar to 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
 

Recently uploaded

%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile EnvironmentVictorSzoltysek
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 

Recently uploaded (20)

%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 

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?