Best practices to manage high volumes of data

This sounds very interesting. I'd like to do this with a Raspberry Pi to collect time based data from the 10 or so Photons I have in my house doing temperature and power line monitoring. I'm more interested in doing larger and faster data sends than off-net functioning.

I've read your TCPServer example using SYSTEM_MODE(MANUAL) which looks very interesting but alerts me to the fact that things can get pretty complicated when you are start communicating with two servers simultaneously.

Do you have some example code which does show best-practice approaches for logging data locally via TCP - to - MySQL local database? That would be very useful and I think of pretty wide interest.
Thanks,
Tim McNaughton