序列化二进制文件与Sql

序列化二进制文件与Sql

本文介绍了序列化二进制文件与Sql Server性能..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我正在考虑部署一个应用程序,它将为我们提供IP地址位置 数据库由Ip2location.com提供... http://www.ip2location.net/ip2locati...component.aspx 他们的.net组件从二进制文件中读取数据。我猜我想知道 这两个选项中哪一个最好。 1)从二进制文件中读取数据(~27) mb左右) 2)或查询具有相同信息的sql DB。 数据库将有大约8列和~180万行。 我正在开发一个高流量的网站,我想查询这个 数据库,以便在访客第一时从数据库中获取城市信息访问网站 (基于他们的IP地址)。 此外,序列化二进制文件如何处理同时文件访问?如果经常阅读 文件,那么 a高流量网站能够有效地使用序列化文件吗? 谢谢! 解决方案 我不认为从文件读取是一个大问题(开放只读),但 仍然需要解析相当数量的数据(27MB)。一个数据库可以很容易地处理那么多数据(它们可以处理许多GB的数据没有问题)。也许最好的办法就是对两者进行基准测试(比如 比较,每次查询1000次并比较花费多少时间) 并做一些加载测试(不仅仅是一个请求,而是 许多同时查询)。我的猜测是结果(哪一个b 效果最好)将根据您拥有的流量,服务器上的负载以及负载而变化。数据库服务器很难 准确地预测什么是最好的。 如果你不需要这个城市,我会建议你有一个看看这篇 文章 http:// www。 eggheadcafe.com/articles/20051109.asp 管理 在RAM中完成所有操作(无文件访问或数据库查询)。 I''m considering deploying an application that will us an IP address locaitondatabase provided by Ip2location.com... http://www.ip2location.net/ip2locati...component.aspxtheir .net component reads data from a binary file. I''m guess i''m wonderingwhich of the two options would be best.1) read data from the binary files (~27 mb or so)2) or query a sql DB with the same info.The database will have about 8 columns and ~ 1.8 millions rows.i''m developing for a high traffic webisite, and i would like to query thisDB to get the City info from the DB when a visitor first visits the site(based on their ip address).Also, how do serialized binary files handle simultaneous file access? Woulda high traffic webisite be able to use a serialized file efficiently if thefile was read often?Thanks! 解决方案I don''t see reading from a file as a big problem (open read-only), butthat''s still a fair amount of data to parse (27MB). A database canhandle that much data easily (they can handle many GBs of data noproblem). Perhaps the best thing to do would be to benchmark both (likesay, query it 1000 times each ways and compare how much time it took)and to do some load testing (not just 1 request after each other butmany simultaneous queries). My guess is that the results (which oneworks best) will vary depending on how much traffic you have, the loadon the server as well as the load on the database server. It''s hard topredict accurately what would work best.If you didn''t need the city I''d recommend you have a look at thisarticle http://www.eggheadcafe.com/articles/20051109.asp which managesto do it all in RAM (no file access or DB queries). 这篇关于序列化二进制文件与Sql Server性能..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-05 09:52