We’d like to support SQL databases in the future, which would give the option to go forward without starting from scratch.
5M cells is indeed a lot.
Having an exporter that could generate an SQL schema + API that replicates what the user's formulas did would be a cool feature, but probably very difficult. I could see building an 80% solution (for your internal use), then selling a consulting service to take your existing Stacker setup and turn it into a bespoke system built on top of a real DB. Presumably by the time the customer has enough records for that to make sense, they would have the money to pay for such a service.
Perhaps you could also offer an "archive your old data after $N years" feature. Maybe also sell snapshot storage, or allow the user to download the archive and save it themselves?
I don't know your tech stack or the business concerns in your space, but maybe that looks like generating a static site that bundles all the user's data, so it can later be viewed in a read-only format using a regular browser (allowing you to just scrape calculated formula values instead of having to implement the formulas yourself). I could see that being useful to a user wanting to pull up a record years down the line as it was displayed when it was created.