Adding "Topics" in a running app. Is it possible

Adding "Topics" in a running app. Is it possible? I have ESP32 modules that I code in certain topics such as 800,801, 1000,1001, etc. Can I add "Topics" while my app is running? Maybe by using TinyDB? I'm new to programming and am building a pretty involved app.
Thanks, Rob

Your use of the word Topics is original.

A bit of data modelling is needed here.

Do you want to capture a time series off a data stream?

Or are you capturing multiple readings simultaneously like temperature and humidity over time?

Learn about using lists:

General Tutorials

I have Arduino devices that operate using messages from MQTT with the publisher sending these messages topic/trains/turnout/1000 etc.
Each device uses two specific numbers. Such as 1000 to move a servo left and 1001 to move a servo right. I need to be able to add a photo of the device and data with the device which would be a device name, a numerical number that is painted on the device and two numbers to activate the device. Ideally I would like to pick the device from a spinner that would show individual photos of the device ( railcars).MQTT model train uncoupler