Yaws is a web server. It likely works with any database of your choice. From my understanding of previous Whatsapp talks, they relied a lot on Mnesia but such talks are at least 4 years old at this point.
A system based solely on Mnesia may perform OK, better or worse than using Mongo or Postgres. It really depends on your domain, your engineering team, your design and the guarantees you expect from the system.