You know you can host a database like Postgres on the same machine, right?

Yes, it's still slower on the same machine, even with unix domain sockets.

It doesn't play nice with other things running with it in practice. JVM and postgres on the same box is a textbook bad time.