If you do not want data shared between the devices, deactivate iCloud sharing for the services you do not want shared. You have several cutting points where this can be done, and syncing will continue between iCloud and the devices still set to use those services.
Read this support article about how to change your iCloud feature settings [iOS and Mac] - Change which apps sync and store data with iCloud - Apple Support - "'When you turn off an iCloud feature on a device, information stored only in iCloud for that feature is no longer available on the device. If you turn off Mail, Contacts, Calendars, Notes, Reminders, or iCloud Photos on just one device, you can still view and change your information on iCloud.com and on another device you set up for that feature."
So, if you want service X on device A to sync with iCloud, but do not want it on device B, turn off syncing for service B with iCloud.