Some time ago I participated in Sitecore Meetup where I had a chance to talk about architecture and technical details of xDB. The presentation file is from 2016, but all the slides are still valid.
I covered there:
- how xDB works from visitor perspective
- Sitecore session states
- MongoDB collections used by xDB and WFFM
- Analytics data aggregation process
- Sitecore xDB servers architecture
Presentation file: xDB Technology.pptx