I'm designing an interface which takes in data from multiple upstream systems. The interface would receive huge amounts of data (~90k).
All the upstream systems send data in different formats as shown below:
For e.g., SYSTEM:
A as XML
B as JSON
C as CSV
Z as {Key1}=Value1
DESIGN-1
A possible solution is to convert all different formats to JSON.
Now there are two major challenges here that I need to address:
Need the data to reach the downstream system as quickly as possible.
Accommodate the addition of new sources, data types with minimal code changes.
For XML, marshalling can help, for CSVs, can create POJOs and map data to them.
DESIGN-2
Store all data as key-value pairs in HashMap.
In this approach, new fields would come in as new keys instead of having to add a new mapping in code as mentioned in DESIGN-1. Less parsing and mappings would make it faster
Can anybody suggest me a better way to do this? Please keep in minds that points 1 and 2 in design 1 are very important.