Obsidian is built on-top of just markdown files, so you can do whatever you want with them. E.g. if you need multiplayer editing you could use 3rd party solutions or even something like HedgeDoc.
Affine is more closer to Notion and self-hostable.
Obsidian: https://obsidian.md/
Affine: https://affine.pro/
It’s open-source, easy to self-host and feature-packed.
GitHub: https://github.com/docmost/docmost.
I'm always disappointed by note-taking tools calling themselves a Notion alternative when they do not provide an alternative to Notion and are instead just another note-taking tool with a simple UI.
If you want to be a Notion alternative provide the things that make Notion great, e.g. the database functionality. It's okay to be a simple colaborative notes tool, but that is not a Notion alternative.