Gluing a Bank Together
Vienna -- 28th August 2007
Paul Johnson
www.pjcj.net
Glue
Perl is often known as a glue langauge
Joins other components together
UBS
"world-leading wealth management company that sits down with you to understand your needs and goals"
www.ubs.com
Marketing division of the Sirius Cybernetics Corporation
UBS
Banks use lots of technologies
They need to be joined together
Perl is good at joining things together
3461 million Euros profit in the second quarter of 2007
Primarily thanks to Perl
(I made that last bit up)
Here comes the science bit!
Banks move lots of money around
By moving money to the right places, banks can earn or avoid paying interest
This makes bankers happy
Go, Johnny, Go!
This process is called:
Cash Management
Perl has helped UBS implement its Cash Management solution
Together with a copious dollop of CPAN
Outsourcing
Primary development is outsourced
Customised product
Needs to be integrated
Systems
databases
webservers
communications
high availability
monitoring
logging
archiving
deployment
Databases
Oracle
create
manage
manipulate
monitor
ad hoc queries
import/export
use DBI;
Webservers
IHS - IBM's rebranding of apache
Websphere
configure
start and stop
monitor
No special modules
Communications
message transfer
mail
SMS
error reporting
IRC
file transfer
Data Munging
Files come in in all sorts of formats
They need to be standardised
pack
and
upack
use Spreadsheet::ParseExcel
MQSeries
message transport
configure
start and stop
read and extract messages
add messages
monitor
use MQSeries;
Kindly written and maintained by our friends at Morgan Stanley
High availability
System handles many millions of [IYFC] per day
Insert Your Favourite Currency
If it breaks, the bank loses many thousands of [IYFC] per not-very-long
system needs to stay up
backup server just waiting to spring into action
mount the disks and start it up
Monitoring
How do we know when something goes wrong?
When should we failover?
Monitor!
Based on Nagios
Plugin infrastructure and plugins themselves written in Perl
Monitor system
application
even business logic
Logging
Logs are important to find out what went wrong
Core application produces many Gb of logs per day
Far to large to be useful
Required restart of aplication every night to rotate logs
Restarting often caused problems in the middle of the night
Made the sysadmins grumpy
Logging
I wrote a wrapper around the logging system
Made the core application write to named pipes
Read the pipes and write to proper log files
Filter the logs
Add timestamps
Add logging levels
Automatic rotation
Logging
use Log4Perl;
Based on
select
Multiple processes
Made the application much more robust
Made the business folk happy
and the sysadmins
Made the logs useful
Archiving
The logs are still enormous
So they need to be archived
Zipped up and stored until they are old enough to be thrown away
Deployment
Sun packages
Package creation
Automated deployment on test machines
Version control with SVK
Extra development
Database Investigation
Management Information System
Legal Archiving
Automated Testing
Database Investigation
Second system
Half external
Internal part based on Catalyst
DBIx:Class, TT, JSON
Management Information System
Daily data copied from DB and sent via file transfer
SQL took 40 hours per day
Rewritten in perl and takes 2 hours
Next version (with DB schema changes) will take 15 minutes
Legal Archiving
Send data to a UBS system
C or Java interfaces
XS ?
Automated Testing
All the Test::* modules
Devel::Cover
WWW::Mechanize
Test::WWW::Selenium
Reading and writing from all interfaces
CPAN
Alien::SeleniumRC Apache::Compress Apache::Filter Apache::Session Apache::Test Archive::Tar Bundle::CPAN Bundle::LWP B::Utils Catalyst Catalyst::Engine::Apache Catalyst::Model::DBIC::Schema Catalyst::Plugin::ConfigLoader Catalyst::Plugin::JSONRPC Catalyst::Plugin::Server::XMLRPC Catalyst::Plugin::Session::State::Cookie Catalyst::Plugin::Session::Store::FastMmap Catalyst::Plugin::Static::Simple Catalyst::Plugin::XMLRPC Catalyst::View::JSON Catalyst::View::TT CGI::Simple::Cookie Class::Trigger CPAN::Mini Crypt::SSLeay Data::Dump Data::Dump::Streamer Data::Page Data::UUID Date::Calc DateTime DBD::Oracle DBIx::Class DBIx::Class::Schema::Loader::DBI::Oracle DBIx::ContextualFetch DBIx::Log4perl DBIx::ProcedureCall Devel::Cover Email::Send Exception::Class ExtUtils::ParseXS File::Find::Rule FreezeThaw HTML::Lint Image::Size JSON Log::Log4perl LWP Module::Build Module::Pluggable MQSeries Net::IRC Net::Server Number::Format Perl::Tidy PPI::HTML Proc::ProcessTable Shell::Source SOAP::Lite Sort::Versions Spreadsheet::ParseExcel SVK SVN::Mirror SVN::Simple::Edit SVN::Web Template Template::Plugin::Number::Format Test::JSON Test::Pod Test::Pod::Coverage Test::WWW::Mechanize Test::WWW::Selenium Text::Table Text::TabularDisplay Text::Template