We have certain design decision to make. Consider the following scenarion.
We have system - say SystemA. This system fetches transactions from an upstream system/service and stores it in a mongoDB collection say Transactions. We are using spring boot to make our web services. Now these transactions goes through certain processing. Here's where we want to take a call :
choice 1 : after the transactions goes through the processing, delete them from transactions collection and move them to ProcessedTransaction collection. Advantage : whenever we want to pick transactions for processing, we alway pick from a very limited number of records. This collection wont grow in size as we will delete transaction records from here once the transactions goes through some processing. Further anyone who needs to query the transaction may query ProcessedTransaction collection.
choice 2 : Simply use an extra attribute say isProcessed and update it to true once the transaction processing is done. Advantage : we dont need to do the deletion and creation of new records regularly. Possible downsides : the collection may grow over time and the performance may reduce.
I am more convinced towards approach 2 but not really sure if my performance considerations are right or not.
Please help me with some suggestions.
Thanks.