I have a situation in which the following business rule exists: when using the system to place an order it is possible to place a progressive discount that is given by adding a variable number of discount percentages that are applied successively.
That is, you can enter in the sequence, for example: 5, 10, 15, representing that a discount of 5% is applied first, then 10% and finally 15%.
Doing this in code is simple, but I'm having trouble persuing this data. The problem here is the fact that the number of discounts is arbitrary. For example: you can enter 3 successive discounts, or 5, or even 10.
If there were a fixed number of discounts that are always applied it seems to me that it would be easy to save this in a relational database. It would be enough to create a table for discounts, one column for each discount.
In this case, I came to think of NoSQL
because of the flexibility of not having to define a table. But I was a little doubtful, because from the little I know about it (I have not yet studied deeply), I think it would be to kill an ant with an atomic bomb. Also, there are several different types of NoSQL
and I'm not sure which one would apply here.
In this way, what would be the most appropriate way for this type of data to persist?