Like mentioned, memory and SSD failure will require a logic board replacement. Apple will cover it if its under warranty (standard or AppleCare+). Outside of warranty and it will cost a fortune, at least through Apple. Hopefully by then its old enough you can get the logic board off eBay for a reasonable price and due it yourself or be ready for a new laptop by then.
Typical memory failure is generally due to socket related issues. Although we don't have upgradability there is a small amount of reliability that comes with RAM being soldered to the logic board. SSD's are fairly reliable as well, being soldered just kills the upgradability.