store SQL query in Session for further processing

Asked

Viewed 62 times

2

I would like to store an SQL query in a Session, that is, all fields and their respective values.

I’d say it’s about 12 fields, and about 150 records on average.

The idea is not to have to consult the database every time you need it, but only once and the others only work on the information that has already been recorded in Section.

This could be bad somehow, it would require from the server in what sense, disk space? Cxb is only worth? , Would that make the answers faster(since I no longer consult the BD this way) ?

1 answer

1

In a succinct way, yes. It would make your application faster since it would not make queries in the database, but it is important to keep in mind the reliability of the data. You need to create ways to ensure that session data is the same as found in the database.

It would be interesting to evaluate in your case cache systems like redis or memcached. I believe this would already make your app faster and more robust.

  • 2

    Is Session stored on Disk? So switching from Database to Disk wouldn’t change much, memcached seems to be the solution for me, I’ll read more about it, value!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.