I've purchased my Nexus 5x just a couple of months ago. Since it's a two-year-old model, you can also get it for a fraction of a flagship model (~$200), and, well, since I've purchased it brand new, I still have a year of security updates + a warranty that lasts exactly that. And on top of that, pure vanilla Android experience + whatever Google comes up with in the meanwhile (for example, I have Google Fi, Pixel camera app, Android Oreo, fingerprint reader at the same spot as this $1000 phone).
Next year I might buy the Pixel (original, not 2). My point is, if that I continue with what I've started this year, I'll upgrade to the next two-year-old Google phone, receive the latest and greatest features (that non-Google-made flagship models still don't have at the time) and I'll receive upgrades constantly.
Either you don't get them and your apps stop working one by one after some time.
Or you get them and performance goes downhill until your apps stop working one by one after some time
The only solution I found was to get a new device every 3-4 years.
I never plan on buying a phone that I would be devastated with the amount lost (like, 1000 bucks) if something ever happens to it for whatever reason.
3 years ago it was a big task to get the devices to speak English and install Google apps.
Now they got onboarding even for German and all things are installed on the first start.
First I had a Huawei Ascend Mate 7 (6") for 2 years, then a Huawei MediaPad X2 (7") for 3 years. Somehow they stopped to build big phones, so I switched to a Xiaomi Mi Max 2 (6.4") and I couldn't be happier.
I paid a fraction of the price of one of those Nexus/iPhone/Samsung flagship Smartphones and they all had what I needed, big display and big battery.