Professional Documents
Culture Documents
Software Architecture - Vivek Rikhari
Software Architecture - Vivek Rikhari
Software Architecture - Vivek Rikhari
This Software Architecture is for one of the leading trading platforms (XYZ- Keeping it confidential). The specific feature will
explain generation of business or legal documents once trade transaction has been successfully placed by the end customer.
FEATURES
1. Identify the type of instrument (Commodities, FX, Equities, Cryptos) for which the transaction has been made
2. Generate documents (including invoices) in the format defined by business/legal.
3. Data should be encrypted at rest.
4. Should be elastic and able to support at least 75K documents per day.
5. Should be shared with third party vendors through SFTP (SSH file transfer protocol)
REQUIREMENT OF THE SYSTEM
Functional Requirements
- The document service will be responsible for below defined XML creations
- XML files will be transferred to 3rd party Vendor (‘X’), who us helping my company with the generation of final terms and condition
documents for the transactions and integrating with regulators on behalf of my company.
- This transfer would be done through SSH File transfer protocol.
Scenarios Supported XML Types Format for the file Number of XMLs File Name Format
When update happens on MFID, KID and PRIPS Defined by the legal team Ideally 1 XML for each MFID_Product-ID_TimeStamp
transactions like overnight stock having details like closing time, underlying instruments (FX,
charges, stock price adjustments, opening time, first trade date, equity) KID_Product-ID_TimeStamp
knockouts or selling product_commercial name. Eg- (i) For every 200 key metric
indexes in the market create PRIPS_Product-ID_TimeStamp
one XML file
(ii) If its more than 800 then use
the following formula
=ROUNDUP(Key Metric
Indexes/200)
When new transaction is created Standard Issue Same as above (Defined by the Same as above; except that the Standard_Product-
business/ legal team) key metrics indexes threshold IC_TimeStamp
becomes 400
MFID & PRIPS Same as above (Defined by the Same as above; except that the MFID-PRIPS-New-IC_TimeStamp
business/ legal team) key metrics indexes threshold
becomes 60
KID Same as above (Defined by the One XML for each language KID-New-Language-Product-
business/ legal team) where the company is ID_TimeStamp
functioning
REQUIREMENT OF THE SYSTEM
1. Volume
- Expected to have number of XML creations up-to 100K per day.
4. Security
- Data should be encrypted at rest
Integrity A user can access only his trade related documents and not for anyone else
(Message Integrity)
1. SECURITY
Use Case – Business wanted to have extreme confidentiality while managing the files as it had legal implications.
Hence, we have made SSL certifications as compulsory for downloading the documents. All the documents are password
protected and cannot be retrieved by anyone else including the company employees.
2. PERFORMANCE
Use Case1- Owing to the high volume of transactions across WW markets, we have implemented SPRING/QUARTZ
Schedulers for automatic generation of documents after a scheduled time.
Use Case2- Owing to usage of private cloud, efficient storage was a major criteria while building this architecture. We
connected with business and understood that documents beyond 1 year of transaction time are not required and not
considered legally relevant (usually the tax period). Hence, we have defined the retention period (480 days) after
which old documents get erased automatically
Tactics used to achieve top 5 ASRs
3. AVAILABILITY
Use Case 1- In the scenario of error (data unavailability), the business wanted the transaction to happen as usual.
Else it would have created panic among the end users. Hence, we enabled exception handling in our modules that
ensures that transaction happen as usual. Further we also run duplicate instances (BLUE AND RED- Refer
Deployment Diagram) to ensure seamless functioning incase one of the instance fails. In parallel we also integrated
‘HEARTBEAT’ in our application which monitors the uptime of the application.
4. TESTABILITY
Use Case 1- One of the major requirement of any trading portal is to monitor the transactions that happened
during the day and accordingly tally it with the legal documents generated. Hence, we built an internal tracker
that ensures that we monitor this data point continuously
5. MODIFIABILITY
Use Case 1- There was a new legal guidance for generating new set of data points having TPIN details. As we
built the new feature, the business ask was to run the system as is and do not impact the existing architecture as it
would impact the customer experience.
UI Document Service 3rd Party Vendor Database KAFKA BUS
Transaction Details
Complete transactions
Submit the transaction details
UI
OFFERING COUNTRIES
Exchange
DOCUMENT DATA
PRODUCT
Issuer Details
TRANSACTION_DATE
DECOMPOSITION DIAGRAM (Data flow model- the system is decomposed into functional modules which transform inputs to outputs)
Transaction event
KAFKA BUS
DOCUMENT SERVICE
DOCUMENT DATABASE
SFTP
USER
SFTP SFTP
DEPLOYMENT DIAGRAM
How the System Works
1. User performs a transaction (buying and selling of a stock) and an event is triggered
2. Document Service Application subscribe to KAFKA topics , which send the details of the event.
4. Document service generates the document based on the predefined business formats.
6. The generated documents will be in the form of pdf and saved in the cloud in the encrypted form.
1. Non Functional Requirements are key for building any new architecture. This helps us understand the business
expectations.
2. The Software Architecture should take into consideration the future requirements and expansion plans.
3. Focus on the ASR while building a new architecture is must to ensure that the system works as per the expectation
and is resilient enough to tackle any unknown events in future.
4. A good and detailed Software Architecture plan helps developers build efficient modules.
5. Software architecture plan helps in making early business decisions as well as feasibility of the system. Hence we
should make it as detailed as possible.
6. Software architecture should ensure transferability of the model. It should have the ability to be reused for
additional use cases.
7. A good software architecture in addition to improving the performance also reduces cost and impacts quality of
deliverables.
8. Software architecture also helps in prioritizing conflicting goals. It helps stakeholders understand the consequence
of their stated requirement.