TRANSFORMING A RUNNING LEGACY APPLICATION INTO HIGH SCALABLE ARCHITECTURE Morten Jokumsen eBay classifieds eBay Inc. confidential
• Morten Jokumsen • Software Architech • Email: mjokumsen@ebay.com • Skype: guidmaster • Twitter: guidmaster
Who and what is DBA? • Old classifieds news paper started in 1981 • First website launched in 1995 • Sold to eBay in 2008 – Price: 370 mill UDS 3 eBay Inc. confidential
DBA 1996 4 eBay Inc. confidential
DBA 1997 5 eBay Inc. confidential
DBA 1999 6 eBay Inc. confidential
DBA 2000 7 eBay Inc. confidential
DBA 2002 8 eBay Inc. confidential
DBA 2004 9 eBay Inc. confidential
DBA 2005 10 eBay Inc. confidential
DBA 2007 11 eBay Inc. confidential
DBA 2008 12 eBay Inc. confidential
DBA 2010 13 eBay Inc. confidential
DBA 2012 14 eBay Inc. confidential
Who is DBA • One of the largest websites in DK • Grows 20% each year • Mobile traffic goes crazy! 15 eBay Inc. confidential
THE CHALLENGE 16 eBay Inc. confidential
Get rid of this! 17 eBay Inc. confidential
Project Mercury 18 eBay Inc. confidential
Why Mercury? Within the realm of astrology the planet Mercury is the ruler of the star sign Gemini. Gemini means twins. This is what we want to do here seen from a business perspective: create a twin of dba.dk running on a more efficient, productive and high-quality platform. 19 eBay Inc. confidential
What we wanted 20 eBay Inc. confidential
Initial guidelines • The architecture must be simple and uniform • Use the Domain Driven Design patterns to gain uniform code and design of the architecture • Code should be high quality which means low bug count and high maintainability • Performance need to be part of the architecture from the start • The architecture is scalable, which made it's easy to scale horizontal by append more servers to make higher throughput • To ensure high quality and clean code, we migrate the existing database in steps to a new database • We migrate with a business scope one to one 21 eBay Inc. confidential
The challenges • Move the architecture from 1999 • Totally new team – Understand the business • Move existing developers to .NET • Totally new technology stack 22 eBay Inc. confidential
And how we did it the first time 23 eBay Inc. confidential
Why did it suck? 24 eBay Inc. confidential
AND WE DID THE SAME MISTAKE IN THE NEXT PHASE 25 eBay Inc. confidential
The first write side • Fighting the O/RM • Anemic Domain Model – Where did the logic go? • Did we do it wrong? – Layered architecture failed? 26 eBay Inc. confidential
Evolve the code base LET´S SCALE 27 eBay Inc. confidential
The problems • We could not scale • We could not implement new stuff fast enough • New developers had a hard time to understand the code base • We said we we did DDD – but we didn´t 28 eBay Inc. confidential
CQRS TO THE RESCUE 29 eBay Inc. confidential
Our implementation of CQRS 30 eBay Inc. confidential
31 eBay Inc. confidential
32 eBay Inc. confidential
The advantage of CQRS • We can scale • We can implement new stuff fast! • We have a clean code base • New developers can easily follow the code base • We know where logic should go 33 eBay Inc. confidential
The advantage of ES • We can change the implementation of the domain • We can scale • Replay the stream • We can debug and fix live bugs • We have better business insight 34 eBay Inc. confidential
The new platform RabbitMQ ASP.NET MVC Dapper MS SQL Server LINQ2SQL CQRS Nagios jQuery DDD Event Store Entity Framework ADO.NET FAST Memcached Miniprofiler 35 eBay Inc. confidential
Where we ended 36 eBay Inc. confidential
Q&A 37 eBay Inc. confidential
38 eBay Inc. confidential
Recommend
More recommend