seamless migration
TRANSCRIPT
The journey to rails
Seamless MigrationJeffery [email protected] | http://debug.ninja
Who am I?
❖ Jeff Yeary❖ Yes I made a slide with my name on it, otherwise I
would forget to have an introduction❖ Software Architect❖ 10 + Years, unique perspective
Outline
❖ Platform [ ~5 min ]❖ History (~2 min)❖ Why a new platform? (~2 min)❖ Rails? (~1 min)
❖ Our basic approach [ ~15 min ]❖ APIs (~3 min)❖ Mobile / responsive site (~2 min)❖ Authentication (~2 min)❖ Zuul (~8 min)
❖ Q/A
Platform: History
❖ Tibco Platform (ASP / C++ / VB)❖ Matrix Platform [US / INTL / MINI] (.Net)❖ Hero Platform (.Net)❖ Niche Platform (Rails 3.0)❖ Highlander (Rails 3.0)❖ Punchkick Tablet Platform (PHP outsourced)❖ Mobile Site (PHP outsourced)❖ Global Responsive Rails Platform (Rails 4)
Which of these is a competitive advantage?
❖ Ability to scale to millions of users❖ Ability to deploy multiple times a day❖ Continuous Integration / Delivery❖ Agile software development process❖ Providing a compelling and engaging user experience
Why write another platform?
❖ Consistent user experience❖ Focus our resources❖ Actually think globally❖ Global feature set❖ Chance to name something (GRRP)
Platform: Rails❖ Fast to deploy (.net was taking an hour to deploy)❖ Fast to develop on (no local compilation)❖ Community (rubygems > nuget packages)❖ Mature
Our basic approach
❖ Changing the tires while the car is in motion❖ Make the change with minimal disruption to the user❖ Same URLs when needed❖ Consistent look and feel❖ Stay logged in across platforms
❖ Adopt SOA -> Create responsive website -> Maintain login state between platforms -> Proxy between the applications
Transitioning: APIs
❖ service-oriented architecture (SOA) is a style of software architecture for designing and developing software in the form of interoperable services. These services have well-defined business functionalities that are built as software components which can be reused for different purposes
❖ Public API❖ Delivery Mechanism
Transitioning: APIs❖ 8 years ago❖ Experiment❖ Supports job search / job application❖ Used to build an accessibility site
❖ 6 years ago❖ Emerging❖ Powers iOS, Android
❖ 4 years ago❖ Established❖ Powers our niche sites, some international sites
❖ 3 years ago❖ Dogfooding stage❖ Transition pages on the matrix platform to call the
same APIs
Transitioning: Mobile site
❖ Started with something impactful (nearly 50% off all of our users are on non-desktop devices)
❖ Opportunity to end desktop / mobile divide❖ Responsive (foundation)❖ First version of this is two separate domains
Transitioning: Authentication
❖ Adopt an oauth authentication flow❖ Two step flow (think facebook connect)
❖ Follow the facebook JS sdk methodology❖ Each platform has its own session but checks back to
the mothership❖ Javascript says something changed, we make a server to
server call to update our session
Transitioning: Reverse Proxy
❖ Now that we have feature parity on our rails platform and we have a central authentication authority we need a way to select between the platforms
❖ Previous experience using HAProxy, NGinx and Zuul
Zuul
❖ What is Zuul? ( github.com/Netflix/zuul )❖ Why use zuul?❖ Very low overhead❖ Powerful language (java / groovy) for making changes
to requests❖ Simple web app example❖ Example does almost everything needed out of the
box
Zuul: High Level
❖ Pre❖ Add a bunch of headers to the request❖ Stats logging about the incoming urls
❖ Route❖ Choose which application to go to, make the request
and send it back❖ Post❖ Stats logging about the time taken for each request
Zuul: It’s this simple
1. https://github.com/cbdr/consumer-zuul-www/blob/master/src/main/groovy/filters/route/SimpleHostRequest.groovy#L1902. https://github.com/cbdr/consumer-zuul-www/blob/master/src/main/groovy/filters/route/SimpleHostRequest.groovy#L240
Zuul
❖ How are routes stored?❖ Each record contains a domain, a destination and a list
of routes{
“incoming_url” => “www.careerbuilder.com”,“destination_elb” =>
“someelb.us-east1.elb.amazon.com”,“routes” => [“/”, “/assets”, “/jobs/[:id]”]
}
Zuul
❖ Route Discovery ( bit.ly/routes-revealer )❖ UI for turning routes on and off ( Show UI )
Conclusion / Questions