Seamless Migration

19
The journey to rails Seamless Migration Jeffery Yeary [email protected] | http://debug.ninja

Transcript of Seamless Migration

Page 1: Seamless Migration

The journey to rails

Seamless MigrationJeffery [email protected] | http://debug.ninja

Page 2: Seamless Migration

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

Page 3: Seamless Migration

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

Page 4: Seamless Migration

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)

Page 5: Seamless Migration

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

Page 6: Seamless Migration

Why write another platform?

❖ Consistent user experience❖ Focus our resources❖ Actually think globally❖ Global feature set❖ Chance to name something (GRRP)

Page 7: Seamless Migration

Platform: Rails❖ Fast to deploy (.net was taking an hour to deploy)❖ Fast to develop on (no local compilation)❖ Community (rubygems > nuget packages)❖ Mature

Page 8: Seamless Migration

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

Page 9: Seamless Migration

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

Page 10: Seamless Migration

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

Page 11: Seamless Migration

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

Page 12: Seamless Migration

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

Page 13: Seamless Migration

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

Page 14: Seamless Migration

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

Page 15: Seamless Migration

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

Page 17: Seamless Migration

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]”]

}

Page 18: Seamless Migration

Zuul

❖ Route Discovery ( bit.ly/routes-revealer )❖ UI for turning routes on and off ( Show UI )

Page 19: Seamless Migration

Conclusion / Questions