“I heard from publishers that 10k copies sold is considered a success, and the publisher may ask you to write another one.”
A traditional publisher pays an author about $3 on a $50 technical book. Gumroad pays 88%. Enterprise Integration Patterns cleared $100k for its authors, spread over about 20 years. Publishers keep the margin and call 10,000 copies a success, because at 6% it’s a success for them.