Maybe this won’t work, but consider the possibility that you may not need a MODx page for every row. You might be able to have a single MODx page that handles multiple rows from a given database table, for example.
One example is how Expression Engine handles stuff like this.... the URL structure is usually
/class/function/id -- e.g.
table_name/read/123. I was working on some CRUD stuff where I brought this up in another thread:
http://modxcms.com/forums/index.php/topic,31477.msg190866.html
The idea being that I could have one MODx document act as a launching point to read from multiple other tables by interpreting the URL segments. e.g.
http://mydomain.com/some/modx/document/custom_id could use the "custom_id" bit to feed a Snippet which would look up the appropriate row in your custom database table.
It’s rare that you’d need 5,000 pages that were unique in format. More likely would be that you had fewer than 10 formats, and hundreds (possibly thousands) of pages that that fell into that format. That’s where you could get some mileage by having the URL supply the id of the related row. Maybe you’ve already seen stuff like
/my/page?id=345. You can have the same functionality with "straight" urls.
Hope this helps.