We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 9 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(7)
只是因为我对它比较熟悉,所以我会选择mysql。要将其用作内存数据库,请使用内存作为表类型。 Redis 是一个内存中的 NoSql 数据库,可能非常适合这种情况(它在内存中运行,仅通过磁盘写入来实现持久性,可以禁用)。
Just because of my familiarity with it, I would go with mysql. To use it as an in memory database use memory as the table type. Redis is an in memory NoSql Database that would probably be a perfect fit for this(It runs in memory, with disc writing for persistence only which can be disabled).
有什么特殊原因不使用打开 RAM 数据库的 SQLite 吗?
Any particular reason for not using SQLite with a RAM db opened?
。您运气不好。任何有权访问该机器的人都可以查看 /proc/$PID/mem 中的数据。
如果您正在谈论非 root 访问,请使用 /tmp/$directory/ 方法和 chmod 700。
You're out of luck. Anyone with access to the machine can view the data out of /proc/$PID/mem anyway.
If you're talking nonroot access than use the /tmp/$directory/ method with chmod 700.
这里有一个你可以在 Linux 下使用的技巧,它被称为“Lazy unmount”。
现在,tmpfs 仍然存在,并且只要进程正在访问它,它就会继续存在,但它不能再被不相关的进程访问,因为它不再存在于其挂载点中。
请注意,这并不会阻止 root 获取 tmpfs 中的数据,只是让其变得更加困难。
另请注意,它可能会被交换,因此如果您绝对需要它是非持久性的,则应该禁用交换(或使用加密交换)。
Here is a trick you can use under Linux, it is called "Lazy unmount".
Now the tmpfs still exists and will continue to exist as long as process(es) are accessing it, but it cannot be accessed by unrelated processes any more as it is no longer present in its mount-point.
Note that this in no way stops root from obtaining the data in the tmpfs, just makes it a little harder.
Also note that it may be swapped, so you should disable swap (or use encrypted swap) if you absolutely need it to be non-persistent.
尝试 Boost.MultiIndex。这不是一个显而易见的选择,但它基于关系数据库概念。
Try Boost.MultiIndex. Not an obvious choice but it's based on relational DB concepts.
将 mysql 与 datadir= 您为此目的安装的 tmpfs 一起使用。当然,您需要编写一些启动脚本来在启动时安装数据库(使用 mysql_install_db 或其他东西),因为您将丢失所有数据。
Use mysql with datadir= a tmpfs you've mounted for the purpose. You'll need to cook up some startup script which installs the database (using mysql_install_db or something) at boot-time, of course, as you'll lose all the data.
memcached 可能是一个可行的解决方案。它是一个键值存储,可以设置为在一定时间内保存值,具有可扩展性,并且易于设置和开始使用。它也可以在各种环境中运行。 这里是 wiki 站点以获取更多信息,特别是因为主页几乎没有任何帮助。
memcached can be a viable solution. It is a key-value store that can be set to hold values for a certain amount of time, is scalable and is simple to set up and start using. It is also run in all sorts of environments. Here's the wiki site for more information, especially since the main page isn't nearly has helpful.