Demand:
1: Each user's shopping cart (CART) is cached in memory with the appropriate data structure.
2: The access to each data object, reasonably set up and manage the cache (using a separate module read and write database). Make the program structure manageable and maintainable.
3: Set a stock for each item. Placing an order (assuming no payment is required) completes the need to reduce inventory.
4: The current inventory of the item details page is loaded with Ajax delay.
Realize:
1: Database uses MongoDB while using Redis to cache part of the data in memory
2: Related data design
Code link Https:https://github.com/sysukinthon/bookstore/tree/master/bookstore
Reference:
1) Torando (MongoDB and template): http://demo.pythoner.com/itt2zh/
2) Redis operation: https://redis-py.readthedocs.org/en/latest/index.html
Using Python to realize online bookstore