In addition to increasing the gap limit you could (1) keep track of the generated addresses in a separate database and use application logic to check for incoming / outgoing transactions
keeping a list of all generated addresses is one thing although it could be simplified to one number i.e. the index of the last address you generated. monitoring utxos is the job of the wallet. if you started doing that in your app you'd be duplicating the work of a wallet. instead it would be better to derive all the private keys upto that index you have stored in your db and import them all into bitcoin core. let core figure out which addresses have utxos.