There are RARE exceptions.
AirTable developed their own DB, but their case may be justified. I listened to an interview with a founder once - very thoughtful and reasonable. They fully understood what they were getting into.
But by default, NEVER:
* Write your own DB
* Write your own search engine to match ElasticSearch or other serious technologies
It will take over your life, and then ruin it.