Anyone can sue, even when there is little likelihood of winning a lawsuit. All you really need is a lot of money and an attorney willing to take it.
The most common lawsuits over book publications occur when the material published is defamatory or when the material published invades someone's privacy. Publishing information that is true can be a defense to any defamation action brought, but truth is not a defense to invasion of privacy.
If you were to publish information about your ex that is judged to be private and personal, he/she could potentially win an invasion of privacy action against you. Disguising a person's identity, or even disguising your own identity by using a pen name, will not prevent a lawsuit if characters in your book can be linked sufficiently to a real person by the facts and characterizations presented. Published memoirs are often the target of both defamation and privacy suits.
In fact, even when an author of
fiction has no intention of patterning a character after a real person, if there is enough similarity between a real person and a character, there can be a successful suit brought against the author. That is why there are disclaimers in the front of fictional books saying things like, "Names, characters, places and incidents are the products of the author's imagination and any resemblance to actual persons, living or dead, is entirely coincidental." This does not
prevent a lawsuit, however, so usually authors and/or publishers will also have insurance to cover the cost of any litigation arising from their publications.