具有套接字功能的内存数据库
蟒蛇--> SQLite --> ASP.NET C#
我正在寻找一个内存数据库应用程序,它不必将接收到的数据写入光盘。基本上,我将拥有一个 Python 服务器,它接收游戏 UDP 数据并翻译该数据并将其存储在内存数据库引擎中。
我不想写入光盘,因为它需要太长时间。数据并不重要,如果出现问题,它只是刷新并填满玩家发送的下一波数据。
接下来,另一个 ASP.NET 服务器必须能够通过 TCP/IP 定期连接到该内存数据库,例如每秒一次或 10 秒一次。它必须提取这些数据,然后这将在显示“实时”游戏数据的网站上更新。
我正在查看 SQlite,想知道这是适合这项工作的工具吗?有人有什么建议吗?
谢谢!!!
Python --> SQLite --> ASP.NET C#
I am looking for an in memory database application that does not have to write the data it receives to disc. Basically, I'll be having a Python server which receives gaming UDP data and translates the data and stores it in the memory database engine.
I want to stay away from writing to disc as it takes too long. The data is not important, if something goes wrong, it simply flushes and fills up with the next wave of data sent by players.
Next, another ASP.NET server must be able to connect to this in memory database via TCP/IP at regular intervals, say once every second, or 10 seconds. It has to pull this data, and this will in turn update on a website that displays "live" game data.
I'm looking at SQlite, and wondering, is this the right tool for the job, anyone have any suggestions?
Thanks!!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
这听起来像是一个过早的优化(如果您已经完成了分析,我深表歉意)。我的建议是继续以最简单、最干净的方式编写系统,但在数据库位周围进行一些抽象,以便可以轻松地交换它们。然后对其进行分析并找到您的瓶颈。
如果事实证明是数据库的问题,请以通常的方式优化数据库(索引、查询优化等)。如果仍然太慢,大多数数据库都支持内存表格式。或者您可以安装 RAM 磁盘并在其上安装单个表或整个数据库。
This sounds like a premature optimization (apologizes if you've already done the profiling). What I would suggest is go ahead and write the system in the simplest, cleanest way, but put a bit of abstraction around the database bits so they can easily by swapped out. Then profile it and find your bottleneck.
If it turns out it is the database, optimize the database in the usual way (indexes, query optimizations, etc...). If its still too slow, most databases support an in-memory table format. Or you can mount a RAM disk and mount individual tables or the whole database on it.
完全不是我的领域,但我认为 Redis 就是这样的。
Totally not my field, but I think Redis is along these lines.
SQlite的应用取决于您的数据复杂程度。
如果您需要对关系数据执行复杂的查询,那么它可能是一个可行的选择。如果您的数据是扁平的(即非关系性的)并且作为一个整体进行处理,那么一些 python 内部数据结构可能适用。
The application of SQlite depends on your data complexity.
If you need to perform complex queries on relational data, then it might be a viable option. If your data is flat (i.e. not relational) and processed as a whole, then some python-internal data structures might be applicable.
也许 AppFabric 适合您?
http://msdn.microsoft.com/en-us/windowsserver/ee695849。 ASPX
Perhaps AppFabric would work for you?
http://msdn.microsoft.com/en-us/windowsserver/ee695849.aspx
据我所知,SQLite 不允许远程“连接”,它只支持作为进程内库调用。不过,您可以尝试使用 MySQL,虽然它比较重,但支持远程连接并且具有内存表。
请参阅http://dev.mysql.com/doc /refman/5.5/en/memory-storage-engine.html
SQLite doesn't allow remote "connections" as far as I know, it only supports being invoked as an in-process library. However, you could try to use MySQL which, while heavier, supports remote connections and does have in-memory tables.
See http://dev.mysql.com/doc/refman/5.5/en/memory-storage-engine.html