1 / 10

Database design considerations for a financial system

Database design considerations for a financial system. Louie Bao. Data Types. Date over Datetime Most financial data such as prices, portfolio holdings, etc are date based and not concerned with the time component.

morton
Download Presentation

Database design considerations for a financial system

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Database design considerations for a financial system Louie Bao

  2. Data Types • Date over Datetime • Most financial data such as prices, portfolio holdings, etc are date based and not concerned with the time component. • The separate Date data type introduced since SQL 2008 significantly reduces date comparison and calculation mistakes.

  3. Data Types • Decimal over Float • Decimal is a precise numerical type whereas Float is an approximate numerical type. • Decimal over Money • Money data type suffers from integer division.

  4. Data Access • Read Committed or RCSI over NOLOCK NOLOCK is bad because: • Uncommitted rows might be returned. • Same record might be accounted twice. • Previously committed rows might be missed. • Query might fail with an error: Could not continue scan with NOLOCK due to data movement.

  5. Data Reconciliation • HashBytes over Checksum • When an MD5 hash algorithm is specified, the probability of HashBytes returning the same result for two different inputs is much lower than that of CHECKSUM.

  6. Data Traceability • Pass as many IDs as far downstream as possible • FileId • AccountId • OrderId • TradeId • SecurityId • etc

  7. Logging • Process Event Log • Info • Warning • Error • Process Progress Log • Started • Running • Completed • Process Exception Log • Invalid/unknown data

  8. Auditing • History Tables • Keep track of who changed what when how. Audit Columns

  9. Security • Group permission over User permission • Add and remove users with ease. • Align permissions with business functions • Testers should not have write access in prod.

  10. References Throw Your MONEY Away http://bradsruminations.blogspot.com.au/2009/11/throw-your-money-away.html Previously committed rows might be missed if NOLOCK hint is used http://blogs.msdn.com/b/sqlcat/archive/2007/02/01/previously-committed-rows-might-be-missed-if-nolock-hint-is-used.aspx Timebomb - The Consistency problem with NOLOCK / READ UNCOMMITTED http://sqlblogcasts.com/blogs/tonyrogerson/archive/2006/11/10/1280.aspx

More Related