Reputation: 25
i would like to ask if is ok to save authorization token as a file in the specific folder. Or will be faster with every request connect to database and compare with token save in the table ? Thanks for answer
Upvotes: 0
Views: 1320
Reputation: 6534
From the "what's faster" standpoint...
Accessing, writing and reading files on the hard disk has its overhead and bears - compared to accessing memory - some performance loss. Databases (again, typically) also store their data on the hard disk, but also often keep data loaded in memory. That's because accessing memory is much faster than accessing files on a hard drive.
So, if you're asking...
The answer would be (most of the times): Database.
Depends on your application.
Upvotes: 1