Is it time to let go?

My boyfriend and I are both 24 and have been together for just under 3 years. We were living in the same city for the first year of our relationship, but have been long distance except for a few months recently when we lived together in a small apartment, far away from any of our friends or family. After 4 months, I was very unhappy and decided to move back to my hometown and have been much happier since.

I have since committed to attend my dream graduate school here for 2 years, and he is considering moving nearby to be closer to family. Since moving apart again, I’ve been worried about us living together again because neither of us were happy but I was especially miserable and I don’t know that things will end well if we attempt it again in the future. We love each other, but are we just wasting each other’s time and prolonging an inevitable breakup if we’re only happy in a long distance relationship and can’t live together?