johhny B
johhny B

Reputation: 1452

Tornado Application design

I'd like people's views on current design I'm considering for a tornado app. Although I'm using mongoDB to store permanent information I currently have the session information as a python data structure that I've simply added within the Application object at initialisation.

I will need to perform some iteration and manipulation of the sessions while the server is running. I keep debating whether to move these to another mongoDB or just keep it as a python structure.

Is there anything wrong with keeping session information this way?

Upvotes: 0

Views: 124

Answers (1)

DrTyrsa
DrTyrsa

Reputation: 31951

If you store session data in Python your apllication will:

  • loose it if you stop the Python process;
  • likely consume more memory as Python isn't very efficient in memory management (and you will have to store all the sessions in memory, not the ones you need right now).

If these are not problems for you you can go with Python structures. But usually these are serious concerns and most of the projects use some external storage for sessions.

Upvotes: 2

Related Questions