For DDS, my (admittedly also vague) understanding is that they use the DDS publish subscribe model to develop various tools which consume the data. A concept diagram (ie marketing material) can be found on this page: https://www.rti.com/products/dds and the addon product would be the database integration service: https://www.rti.com/products/dds/add-on-products
Looking at it more thoroughly I think its probably way past what you need and geared towards a different use case.
As for the OPC UA, you probably wouldnt need a DSC runtime license in that situation, since you're using the separate modbus library. To make sure I'm being clear, I would see you running an embedded OPC UA server within your application, which itself could host a short term historical log. For longer term logging I'd imagine using a different vendor with the capability of pulling data from any OPC UA server, using OPC UA as the standard scada protocol backbone for your system. I don't have a specific recommendation for this, but a quick google "OPC UA data historian" comes up with this as an example: https://opcfoundation.org/products/view/prosys-opc-ua-historian and that company also has an opc ua client and this thing: https://www.prosysopc.com/products/opc-ua-modbus-server
All that having been said, if you have a very small system and licensing costs are a concern, all of the above is probably overkill. A lot of these integrated logging solutions seemed to be geared towards bigger systems and so is the pricing.
Edit:
These two occurred to me: https://www.daq.io/what-daqio-is/
Looks like its a sort of integrated solution for historical data using a simple web-based labview API. I cannot speak to it past having seen a demo at some point.
https://www.influxdata.com/time-series-platform/telegraf/
I had thought about using this myself at one point, but my goals got redirected. As I recall its a time-series database with visualization tooling "chronograf" and a simple HTTPS interface for inserting data.