One of the core ways to model this is to have a process running the cart itself and another with the data. If you wish for that cart data to be persistent, used DETS (writes to disk) just in case.
The data will have to be persisted eventually once the order is finished, keeping that data on process memory would be incredibly irresponsible. And by all means if you ever do an ecommerce app please use an external database. You will want to do all kind of things with the data outside of the usage of the application, like running reports , etc.