I have a usecase where data transitions from one state to another.
There are Four values which I can use.
- Order number - ( An order has multiple transitions)
- Current State
- Date of Transition
- Previous State.
I need to store the data in such a way that the following condition
- Fetch all the transitions for a given order number
- From the data fetched, the order of transition should be understood.
I thought of two ways to store it.
Map<Integer, Map<String, Date > >
Where Integer is the outer Key and Status is the inner key. Date is used for the getting the order of transition
or
Map<Integer, Map<String, String > >
Where Integer is the outer Key and current Status is the inner key and its value is previous status.
Which would be a better implementation performance wise. Suggest a better implementation if possible.
And I want to store this data in a distributed cache like redis or aerospike.
Is there a way to store any of the above structures in them? For my use case which would be better redis or aerospike ? Is any other better option available.
Thank You.
(I'm new to both aerospike and redis)