Functional Programming In Real Life

Similar documents
All you need is fun. Cons T Åhs Keeper of The Code

ACN INDEPENDENT BUSINESS OWNER GUIDE TO CUSTOMER EXPERIENCE

Erlang. Joe Armstrong.

Programming Paradigms

Erlang. Joe Armstrong

Erlang 101. Google Doc

Message Passing. Advanced Operating Systems Tutorial 7

JANUARY 2018 TABLE OF CONTENTS

South Central Power Stop Scams

Disaster Recovery as a Service

Scripting with Luerl

ERLANG EVOLVES FOR MULTI-CORE AND CLOUD ENVIRONMENTS

An Introduction to Erlang

Introducing. Worldpay Total. Worldpay international omni-channel payment solution

2013 CONSUMER MOBILE INSIGHTS STUDY!

Everything you need to know about cloud. For companies with people in them

10 Hidden Costs of a Premises-Based (PBX) System

Welcome to this IBM Rational Podcast. I'm. Angelique Matheny. Joining me for this podcast, Delivering

Image Credit: Photo by Lukas from Pexels

Robust Erlang (PFP Lecture 11) John Hughes

Distributed Architectures & Microservices. CS 475, Spring 2018 Concurrent & Distributed Systems

Is Functional Programming (FP) for me? ACCU Conference 2008 Hubert Matthews

ACCOUNTING AND CORPORATE OFFICE SOLUTIONS

Engineering Robust Server Software

Go Cloud. VMware vcloud Datacenter Services by BIOS

Community Clouds And why you should care about them

An Introduction to Erlang

This Online Gaming Company Didn t Want to Roll the Dice on Security That s Why it Worked with BlackBerry

THE SECRET FOR MAKING MONEY ONLINE

ON SCHEDULE TERMS AND CONDITIONS (September 23rd 2018)

Erlang in the battlefield. Łukasz Kubica Telco BSS R&D Department Cracow Erlang Factory Lite, 2013

English step-by-step guide for the web shop at Riddarhuset.se

Services in the IMS ecosystem

Key questions to ask before commissioning any web designer to build your website.

Freecoms VoIP Mobile Community Telecom S. Ferrari, page n 1»

Chapter 6 Architectural Design. Lecture 1. Chapter 6 Architectural design

Welcome to Python! If you re the type of person who wants to know

The Golden Trinity of Erlang How Something Simple Has Real Business Value

SOFTWARE DEFINED STORAGE VS. TRADITIONAL SAN AND NAS

2017 Paul Krzyzanowski 1

WHAT CIOs NEED TO KNOW TO CAPITALIZE ON HYBRID CLOUD

Introduction to emanagement MGMT 230 WEEK 4: JANUARY 29. Implementing basic e-commerce: technologies and options

Computer networks 2013

Erlang and Concurrency. André Pang Rising Sun Research

LFE - a lisp on the Erlang VM

Web Host. Choosing a. for Your WordPress Site. What is web hosting, and why do you need it?

ARCHIVE ESSENTIALS

Chapter 6 Architectural Design. Chapter 6 Architectural design

Name Jim Nolan Title Owner Company Name James Nolan Law Office. 65 Broadway, Suite 707, New York, NY 10006, (212)

Sage One Accountant Edition. User Guide. Professional user guide for Sage One and Sage One Accountant Edition. Banking. Invoicing. Expenses.

The Benefits of SMS as a Marketing and Communications Channel From The Chat Bubble written by Michael

Launch Store. University

CaptainCasa Enterprise Client. CaptainCasa Enterprise Client. CaptainCasa & Java Server Faces

Quick Start Guide. Quick Setup Add Your First Client & Case Track Time & Get Paid Bonus Setup Tips Additional Resources For Your Business

WEB SECURITY WORKSHOP TEXSAW Presented by Solomon Boyd and Jiayang Wang

Designing for Scalability. Patrick Linskey EJB Team Lead BEA Systems

IBM WebSphere Application Server V3.5, Advanced Edition for Linux Extends Support to Red Hat, Caldera, SuSE, and TurboLinux

BUYING DECISION CRITERIA WHEN DEVELOPING IOT SENSORS

WHITEPAPER MOVING TO A NEW BUSINESS PHONE SYSTEM

The New Individual TV Experience. Are you my televisionary?

BKT KOSOVA BUSINESS E-BANKING USER MANUAL

Engineering Robust Server Software

IBM Secure Perspective bridges the gap between data security policy and practice

г. Moscow, 89, Krasnobogatyrskaya, bld.1 +7 (495) (495) TECHNOLOGIES OF ENGINEERING

WHITE PAPER. Header Title. Side Bar Copy. Header Title 5 Reasons to Consider Disaster Recovery as a Service for IBM i WHITEPAPER

DESIGNING RESPONSIVE DASHBOARDS. Best Practices for Building Responsive Analytic Applications

Choices when it comes to your communications infrastructure A BUYER S GUIDE TO IP-BASED SOLUTIONS

To learn more about Stickley on Security visit You can contact Jim Stickley at

Erlang and Thrift for Web Development

The do s and don ts of error handling. Joe Armstrong

CLICK TO EDIT MASTER TITLE STYLE Fraud Overview and Mitigation Strategies

Luerl - an implementation of Lua on the Erlang VM

Set your office free.

Microsoft Virtualization Delivers More Capabilities, Better Value than VMware

Privacy & Cookie Statement

Personal Cybersecurity

Foot printing 102. Four more: AS to Netblock Robtex / Cymru Netblock to IP address(es) Just expand

$540+ GST Paid Annually. Professional Website Hosting Service HOSTING:: WHAT YOU GET WORDPRESS:: THEME + PLUG-IN UPDATES

VOXOX. A Tell-All Guide EVERYTHING YOU NEED TO KNOW ABOUT HOSTED PBX. a VOXOX ebook VOXOX, Inc A Comprehensive Guide

Recipes. Marketing For Bloggers. List Building, Traffic, Money & More. A Free Guide by The Social Ms Page! 1 of! 24

WELCOME GUIDE All you need to know!

5. search engine marketing

How To Make 3-50 Times The Profits From Your Traffic

Operating Systems. 18. Remote Procedure Calls. Paul Krzyzanowski. Rutgers University. Spring /20/ Paul Krzyzanowski

SEO: SEARCH ENGINE OPTIMISATION

4. Backlink Analysis Check backlinks What Else? Analyze historical data... 29

RED HAT ENTERPRISE LINUX. STANDARDIZE & SAVE.

YOUR CUSTOMERS WANT MORE. GIVE THEM MORE.

T Mobile Manual Contract Cancellation Fee 2012

CSE 561 Lecture 6, Spring David Wetherall

Consumers Use of Mobile Financial Services 2015

Lesson 2. Introducing Apps. In this lesson, you ll unlock the true power of your computer by learning to use apps!

2012 Business Continuity Management for CRISIS. Network Infrastructure for BCM

The Shortcut Guide To. Protecting Against Web Application Threats Using SSL. Dan Sullivan

Connected vehicle cloud Commercial presentation

HyperDialer Tutorial By Phone Broadcast Club

Table of Content. Market Trend

Hello, my name is Cara Daly, I am the Product Marketing Manager for Polycom Video Content Management Solutions. Today we are going to look over the

Keep in touch by -- without a computer!

Distributed Ledger Technology & Fintech Applications. Hart Montgomery, NFIC 2017

Transcription:

Functional Programming In Real Life Dr. Erik Stenman CTO Kreditor Europe AB Creative Payment Solutions

Introduction I will talk about KREDITOR, a company that bet it's future on Erlang, a functional programming language I will tell you what KREDITOR does, how we do it, why we do it this way, and whether it worked out or not... at least, so far. I will also tell you about Erlang, and why and why not to use it.

The business model: Kreditor Europe AB Bring trust to Internet shopping. Bring old style billing into the new IT-economy. Brief background: Founded in February 2005. With < $100,000 in venture capital. Live system in March 2005. The company vision: Be the coolest company in Sweden.

The Problem Internet shopping is a question of trust. The shop has to trust the customer to get paid. The customer has to trust the shop to send the right stuff. Many customers are uncomfortable using credit card over the Internet. Many banks are actually worried about the security of Internet shops handling credit card information.

The Solution Bring in a trusted party, i.e., KREDITOR. Send an invoice with the goods to the customer. The customer pays after receiving the goods and takes no risk. The customer does not have to trust anyone. The shop is guaranteed (by contract) to get money from KREDITOR. The shop only have to trust KREDITOR with whom they have a written contract.

The Implementation surfs A webshop xm l rpc A customer identity kredit check Credit information KREDITOR

The Implementation surfs A webshop xm l rpc A customer stores Credit information KREDITOR DB

The Implementation surfs Ok A webshop, in vn o= 42 A customer Credit information KREDITOR DB

The Implementation Pack goods, print invoice, ship. Buy ok A webshop A customer Credit information KREDITOR DB

The Implementation A webshop Pa y Pay A customer Credit information Pay Bank KREDITOR DB

The Implementation A webshop A customer Credit information Print&mail Bank r m Re e ind KREDITOR DB

Some details The system is built from scratch using LYME (Linux, Yaws, Mnesia, and Erlang). So far we operate in Sweden and Finland, and we sell to Norway and Denmark. We have a distributed system with multiple servers to provide a fault tolerant, high availability solution. We aim for less than 5 minutes down-time per year, in a setting where we introduce new features in the system every week. The problem fits Erlang really well.

Why not use Erlang? The main reasons that I have heard of are: 1. Politics Erlang is not C/Java, company policy. 2. One provider Concern that Ericsson will stop supporting Erlang. 3. Lack of programmers Erlang is still not mainstream how can we ensure we get qualified staff? When starting a new company, 1 is (usually) not a problem. I can't see 2 happening, and Erlang is open source anyway. When setting up in Stockholm, 3 is not a problem.

Erlang - Background Developed by the Computer Science Lab at Ericsson. Problem domain - Telephone Modern financial exchanges. applications High Availability Highly concurrent Real time Distributed Continuos operation In service upgrades

Erlang Design Goals* How can we build software systems that are as reliable as hardware systems. How can we make programming almost as easy as assembling hardware. * This is my own reconstructed view of what the goal might have been, I was not in any way involved in the design of Erlang.

Erlang - Insight To make a faulttolerant system you need at least two computers.

Real - Insight Actually, to make a faulttolerant system you really need at least three computers*. * This is an insight about consensus algorithms shown by Leslie Lamport in The Byzantine Generals Problem (1982) and in more detail in Lower Bounds for Asynchronous Consensus (2004).

Erlang - Background The Erlang designers realised To do fault tolerant computing we need at least two isolated computers. This lead to concurrent programming with pure message passing and no shared state. Large number of (isolated) processes Communication through message passing No mutable state in processes Pure functional programming

Erlang - OTP A huge part of the success of Erlang comes from the standard library OTP (Open Telecom Platform). OTP extends the fault tolerance in Erlang by providing standard patterns (or behaviours in Erlang lingo) for building telco-grade systems. Supervisors, with restart polices Generic servers Generic state machines Logging

The Erlang Advantage Easy to build fault-tolerant systems. Rapid development. Low-maintenance and easy upgrade. Ability to leverage multicore technology. Network programming is easy. Good way to get great programmers.

Easy to Build Fault-tolerant Systems Erlang was designed from the ground up with the purpose of making it easy to develop fault-tolerant systems. Erlang was developed by Ericsson with the telecom market in mind. Erlang supports processes, distributed systems, advanced exception handling, and signals. Erlang comes with OTP-libraries (Open Telecom Platform), e.g. supervisors and generic servers.

Rapid Development Erlang has a number of features to support rapid prototyping and fast development: Automatic memory management. Symbolic constants (atoms). An interactive shell. Dynamic typing. Simple but powerful data types. Higher order functions and list comprehensions. Built in (distributed) database.

Fast Development Erlang has a number of features to support rapid prototyping and fast development: Automatic memory management. Symbolic constants (atoms). An interactive shell. Dynamic typing. Simple but powerful data types. Higher order functions and list comprehensions. Built in (distributed) database. 23

Low-maintenance and Easy Upgrade Erlang has a number of features that makes it easy to maintain and upgrade: Hot code loading. Distribution. Interactive shell. Simple module system. No shared state. Virtual machine.

Ability to Leverage Multi Core The concept of processes is an integral part of Erlang. The Erlang Virtual machine (BEAM) has support for symmetric multiprocessing. No shared memory -- easier to program. As Joe Armstrong is found of saying: Each year your sequential programs will go slower. Each year your concurrent programs will go faster.

Network Programming is Easy Distributed Erlang solves many network programming needs. Setting up a simple socket protocol is a breeze. The binary- (and now bit-) syntax makes parsing binary protocols easy. There are simple but powerful libraries for HTTP, XML, XML-RPC and SOAP.

Good Way to Get Great Programmers Nice paradox: The lack of Erlang programmers makes it easier for us to find great programmers. There are many great C and Java programmers, I m sure, but they are hidden by hordes of mediocre programmers. Programmers who know a functional programming language are often passionate about programming. Passionate programmers makes Great Programmers.

Building a Scalable Fault-tolerant 24/7 System You need at least three of everything Start simple Only optimise when and where necessary Scale by adding nodes, make each node the same as all other nodes Monitor everything

Erlang Downsides It is not mainstream* There are not many third party libraries yet Even if we can find great programmers it is hard to find enough programmers who know Erlang or who even want to use Erlang. * A big advantage according to Paul Graham in Beating the Averages.

Making Erlang More Mainstream I have a cunning plan. We set up an independent language ranking firm, paid by the Erlang community of course. They rank Erlang as an AAA language. Every manager faced with a language decision can then make the non-decision of choosing the tripel AAA language Erlang.

Erlang is Gaining Popularity Erlang for Concurrent Programming, by Jim Larson, Google: Designed for concurrency from the ground up, the Erlang language can be a valuable tool to help solve concurrent problems. (http://www.acmqueue.com/modules.php?name=content&pa=showpage&pid=556) New Facebook Chat Feature Scales to 70 Million Users Using Erlang (http://highscalability.com/new-facebook-chat-feature-scales-70-million-users-using-erlang) Dr.Dobb s 3/12: It's Time to Get Good at Functional Programming Erlang: A No-Compromises Approach (http://www.ddj.com/development-tools/ 212201710;jsessionid=AGLEX11IQPUNQQSNDLRSKHSCJUNN2JVN?pgno=2)

When not to Use Erlang Don t try to build a stand-alone GUI. Don t expect to do fancy text handling out of the box. A fancy web-gui is not easy to do yet. Fast file crunching is not Erlangs forte. But Erlang can easily interface with other languages and applications, so use Erlang as the glue to write the robust server core, and plug in the missing parts.

Did it work? Erlang has been a great help in providing rapid development with maintained high availability. KREDITOR has introduced new services several times per year. The system has never been down. Not even while upgrading the system hardware or moving the hosting to a new site.

Some Customers We have signed with over 2700 internet shops. (Dustin, Ginza, Discshop, SIBA, Webhallen, Gymgrossisten)

Did it work? The business model has been sound. Stores Number of connected stores: 2004: 0, 2005: ~200, 2006: ~800, 2007: ~1700, 2008: ~2800 Number of employees ~100. Turnover: 2004: ~0 SEK 2005: 1.5 million SEK Turnover MSEK 2006: 13.5 million SEK 2007: 35 million SEK 2008: 90 million SEK

Conclusion KREDITOR took a bet on Erlang, and we are winning. Questions?

Added benefits The customer gets credit. The customer can pay using familiar methods. Returning goods is easy. Better fraud detection. Advanced credit assessments. Easy to add similar features like pre-pay, subscriptions and instalment plans.