Practical Databases
description
Transcript of Practical Databases
![Page 1: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/1.jpg)
Practical Databases
A look at DBMS in practice:
A Trading and Inventory System
![Page 2: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/2.jpg)
Introductory Guff
• Your speaker is Dr Richard Keeble;
• Today’s talk - a look at database systems in a real-life environment ...– A case study of real systems in a real company;– A look at the bigger issues surrounding
database systems in financial environments.
![Page 3: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/3.jpg)
What I’ll Talk About
• Business background and rationale:– What systems did we look after and why?– How did they support the business goals?
• A look at the systems themselves:– The various components and their relationships;– How the different elements of the business
interact and are supported by the technology.
![Page 4: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/4.jpg)
What You’ll Get Out Of This
• An idea of the scale and complexity of ‘enterprise’ database systems;
• An insight into how business systems fit together and inter-operate;
• A look at some of the problems in the development of business database applications;
• Experience from others’ cautionary tales ... !
![Page 5: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/5.jpg)
The Business: What
• Goldman Sachs:– General Activities:
• Investment Banking;• Proprietary Trading.
– My responsibilities:• Front-line support;• Routine maintenance and development;• Flow testing;• New development, test and commission.
![Page 6: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/6.jpg)
The Business: What & Why
• What’s a ‘Repurchase Agreement’ (‘Repo’)?– A short-term collateralised loan.
• What’s it for?– Short-term low-risk borrowing and lending;– Also allows GS to spend the same money
several times a day … !
![Page 7: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/7.jpg)
Repo Trades
• Legal definition:– ‘an agreement to sell and a simultaneous
forward agreement to re-purchase’.
• Contrast to a ‘normal’ trade:– A repo has a start and an end, as opposed to a
share purchase which is a single event.
![Page 8: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/8.jpg)
An Example Repo Trade• A one-week repo at 5% for EUR 10MM vs.
10MM BUNDs at par:– Start cash = 10MM EUR;– End cash = 10MM EUR + 9,491.48 EUR interest;– One Trade, but two Business Transactions:
RP 10MM EUR vs 10MM BUND
NEWPIECE
FULLRETURN
SELL
2003-01-30
RE-PURCHASE
2003-02-06
![Page 9: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/9.jpg)
Trading Volumes
• Usually around 1300-1400 trades done per day;
• Somewhere around 15,000 trades active at any point;
• Approximately 40,000 different securities may be traded;
• So how do we know what’s going on?
![Page 10: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/10.jpg)
Security Projections
• Sister to the NDR trading systems;
• Shows traders and operations the Firm’s commitments summed over time, sorted:– By bond or bond group (called ‘book’);– By currency;– By legal entity.
• Critical for keeping all the plates spinning!
![Page 11: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/11.jpg)
Roles in the System
• Front Office:– Traders, salespeople, trading assistants.
• Middle/Back Office:– Daily trading operations staff, controllers,
clearance support staff and operations.
• IT Personnel:– Looking after all of the above.
![Page 12: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/12.jpg)
The Bigger Picture
• Repo acts as both a source and a sink for information streams from many places:– As a sink for: currency rate information, inter-
company trading data;– As a source for: other firm groups (cash ledgers,
stock control, trading position management systems), legal, regulatory and clearing houses.
• Projections: only a sink (easier to look after!)
![Page 13: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/13.jpg)
Trade is BookedREPO
(repo_db)PROJECTIONS
(secproj_db)Trade Entry
Traders
Security Projections
Window
Traders & Operations
OUTSIDE
![Page 14: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/14.jpg)
Postings GeneratedREPO
(repo_db)PROJECTIONS
(secproj_db)Trade Entry
Traders
genesis2
Security Projections
Window
Traders & Operations
OUTSIDE
![Page 15: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/15.jpg)
Trade Hits ProjectionsREPO
(repo_db)PROJECTIONS
(secproj_db)Trade Entry
Traders
genesis2trades
Security Projections
Window
Traders & Operations
OUTSIDE
![Page 16: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/16.jpg)
Trade Posts InternallyREPO
(repo_db)PROJECTIONS
(secproj_db)Trade Entry
Traders
genesis2
Cash
Bonds
trades
Security Projections
Window
Traders & Operations
OUTSIDE
![Page 17: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/17.jpg)
Clearance Instructed
Banks, Clearing Houses
REPO(repo_db)
PROJECTIONS(secproj_db)
Trade Entry
Traders
genesis2
Cash
Bonds
trades
Security Projections
Window
Traders & Operations
OUTSIDE
![Page 18: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/18.jpg)
Confirm Received
Banks, Clearing Houses
REPO(repo_db)
PROJECTIONS(secproj_db)
Trade Entry
Traders
genesis2
Cash
Bonds
trades
settlements
Security Projections
Window
Traders & Operations
OUTSIDE
![Page 19: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/19.jpg)
Trade Settled – Done!
Banks, Clearing Houses
REPO(repo_db)
PROJECTIONS(secproj_db)
Trade Entry
Traders
genesis2
Cash
Bonds
trades
settlements
Security Projections
Window
Traders & Operations
OUTSIDE
Exception Window
Operations
![Page 20: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/20.jpg)
No Settlement?
Banks, Clearing Houses
REPO(repo_db)
PROJECTIONS(secproj_db)
Trade Entry
Traders
Exception Window
genesis2
Operations
trades
Security Projections
Window
Traders & Operations
OUTSIDE
![Page 21: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/21.jpg)
Call The Counterparty!
Banks, Clearing Houses
REPO(repo_db)
PROJECTIONS(secproj_db)
Trade Entry
Traders
Exception Window
genesis2
Operations
trades
Security Projections
Window
Traders & Operations
OUTSIDE
![Page 22: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/22.jpg)
Confirm Received (At Last)
Banks, Clearing Houses
REPO(repo_db)
PROJECTIONS(secproj_db)
Trade Entry
Traders
genesis2trades
settlements
Security Projections
Window
Traders & Operations
OUTSIDE
Exception Window
Operations
![Page 23: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/23.jpg)
Trade Settled – Done!
Banks, Clearing Houses
REPO(repo_db)
PROJECTIONS(secproj_db)
Trade Entry
Traders
genesis2trades
settlements
Security Projections
Window
Traders & Operations
OUTSIDE
Exception Window
Operations
![Page 24: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/24.jpg)
Transactions: 1
• Absolutely essential in sizeable, production systems:– To ensure integrity of data during protracted
operations on the database;– To regulate concurrent accesses to the database.– By making it appear to whatever application or
process that they are the only database user.
![Page 25: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/25.jpg)
When It’s All Gone Pear-Shaped
• Sometimes, there is no alternative to manipulating the database directly:– The dreaded ‘Manual Update’!
• These are dangerous things to do:– In ‘Production’, you’ve no room for error;– How can you make adjustments and verify
they’re correct?
![Page 26: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/26.jpg)
Transactions: 2
• Also extremely important in supporting a real-time system where occasional manual updates are required:– Used correctly, you can do no wrong!– Just remember to always be in a transaction, or
bad things may happen ...– And don’t forget the transaction afterwards ...
![Page 27: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/27.jpg)
Environmental Separation
• Using separate databases for different activities:– Development and Testing;– QA: Quality Assurance;– Production and Archival.
• Much safer to use ...– ... as long as you remember where you’re
looking at!
![Page 28: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/28.jpg)
Multi-Tier Applications
• The ‘n-tier’ application development idea:– 2-tier: user interface and database;– 3-tier: UI, business logic, DB;– 4-tier: UI, middleware, BL, DB.– and so on ...
• A lot depends upon the application’s particular requirements:– Requirements can change over time ...
![Page 29: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/29.jpg)
Example: Trade Entry
• A collection of windows used by traders to book trades.
• ‘2.5-tier’ architecture (apps, SPs+DB):– In the first place, a good thing: TE was the only
source of trades and adjustments;– As time passed, a bad thing: business logic
intertwined with UI software, plus additional sources of trading information.
![Page 30: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/30.jpg)
Problems
• The rules for ‘genesis2’:– Flexible rules, based on trade types (and other
criteria);– Easily configurable without changing the
program;– But is there a price to pay?
• What if the rules are wrong?
![Page 31: Practical Databases](https://reader036.fdocuments.net/reader036/viewer/2022062309/56814a1f550346895db7497b/html5/thumbnails/31.jpg)
So, are there ...
•Any questions?