开发者

Where to create session instances?

开发者 https://www.devze.com 2023-02-24 08:10 出处:网络
So I am creating C++ HTTP emulating via TCP server. I will have simple authentification service which will be created in C++. I will have sessions. I wonder which form shall I give them - real files o

So I am creating C++ HTTP emulating via TCP server. I will have simple authentification service which will be created in C++. I will have sessions. I wonder which form shall I give them - real files on server or lines in SQL Lite db I use for my server? Or just keep them in RAM开发者_如何学编程? Which way is better for performance / safety?


It all depends what you want to do:

  • keep them in sqlite is safer than file (you're sure it's either written or not, no half status). Moreover, it's either to fetch your session with a query. In that sense, it's safer
  • keep them in RAM will be better in terms of performance, but all sessions will be lost when you restart your server
0

精彩评论

暂无评论...
验证码 换一张
取 消