Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Migration from Erlang to OTP A case study of a heavy duty TCP/IP client/server application Francesco Cesarini Mickaël.

Similar presentations


Presentation on theme: "The Migration from Erlang to OTP A case study of a heavy duty TCP/IP client/server application Francesco Cesarini Mickaël."— Presentation transcript:

1 The Migration from Erlang to OTP A case study of a heavy duty TCP/IP client/server application Francesco Cesarini francesco@erlang-consulting.com Mickaël Rémond mickael.remond@erlang-fr.org

2 The Product... n IDEALX runs in-house customer projects –Based on Open Source components –develop what is not available –release reusable applications on their site n Develop an Instant Messaging Server –For one of the largest French ISPs –Handle 10,000 simultaneous users –Based on the Jabber protocol –Scaleable during runtime –Allow flexible addition of services

3 The Product...

4 Building the Prototype. n A team of 4 software engineers n Erlang Knowledge –All self-taught –Had been active in in-house Erlang projects –Used the erlang-questions mailing list n They had a working prototype in 5 weeks –Handled 900 simultaneous users –Had performance and reliability problems n Delivered to an impressed customer

5 Building the Prototype. n Decide to take in external help –Code & Architecture review –Improve performance –Explain OTP behaviours n The code review showed –Well written code –Little use of higher order functions –Lots of unnecessary concurrency –NO OTP behaviours or design principles!!

6 Building the Prototype. multiplexing de-multiplexing state/error handling users socketslistener sockets

7 How could they miss OTP? How do I apply object oriented design in Erlang? How do I apply object oriented design in Erlang? Mickaël Rémond Joe Armstrong You do not need to apply OO design as Erlang has something more powerful called behaviours!

8 How could they miss OTP? n The name Open Telecom Platform –They were developing XML based products –They were developing products for ISPs –They were not developing telecom products n They did not find the documentation –Relations between behaviours not evident –No tutorials n Found very few OTP examples online

9 To the Rescue! n OTP training: 2.5 days –Only behaviours were covered n Code review: 1 day n New system architecture design: 0.5 days –No documents necessary n ‘Code rewrite’ examples: 1 day –Using higher order functions –How to remove deeply nested cases –Bit syntax, etc.

10 To the Rescue! multiplexing de-multiplexing state/error handling users socketslistener de-multiplexing socketssupervisor simple 1-1

11 To the Rescue! n 25 days work from prototype to product –Included training, redesign, rewriting, testing n Code reduction of 50% n Free goodies from OTP –Restart strategies, application control, etc. n Problems –Limit of TCP connections per Unix process –One listen socket for many Erlang nodes –Windows NT database performance

12 The Moral of the Story. n OTP design principles and behaviours fill a gap that existed in pure Erlang –Structuring of programs –Reuse of Code –Methodology –Development strategy n For some one downloading Erlang/OTP off the web, finding/understanding design principles and behaviours is not obvious/easy.

13 The Moral of the Story. n We who work with OTP should promote it better –Advantages –The gap it fills –More and better examples –Help existing open source projects n Hopefully, this will result in others not doing the same mistake –Happy users = Many users –Many users = Fun user conferences


Download ppt "The Migration from Erlang to OTP A case study of a heavy duty TCP/IP client/server application Francesco Cesarini Mickaël."

Similar presentations


Ads by Google