473,385 Members | 2,015 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

serialized binary files vs Sql Server Performance..

I'm considering deploying an application that will us an IP address locaiton
database provided by Ip2location.com...

http://www.ip2location.net/ip2locati...component.aspx

their .net component reads data from a binary file. I'm guess i'm wondering
which 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 this
DB 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? Would
a high traffic webisite be able to use a serialized file efficiently if the
file was read often?

Thanks!
Jan 6 '06 #1
10 2326
Fabuloussites wrote:
I'm considering deploying an application that will us an IP address locaiton
database provided by Ip2location.com...

http://www.ip2location.net/ip2locati...component.aspx

their .net component reads data from a binary file. I'm guess i'm wondering
which 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 this
DB 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? Would
a high traffic webisite be able to use a serialized file efficiently if the
file was read often?

Thanks!


I don't see reading from a file as a big problem (open read-only), but
that's still a fair amount of data to parse (27MB). A database can
handle that much data easily (they can handle many GBs of data no
problem). Perhaps the best thing to do would be to benchmark both (like
say, 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 but
many simultaneous queries). My guess is that the results (which one
works best) will vary depending on how much traffic you have, the load
on the server as well as the load on the database server. It's hard to
predict accurately what would work best.

If you didn't need the city I'd recommend you have a look at this
article http://www.eggheadcafe.com/articles/20051109.asp which manages
to do it all in RAM (no file access or DB queries).
Jan 6 '06 #2
Actually,
you can get all this information for free without a database
by using the MSN Virtual Earth script generated by this URL:

http://local.live.com/WiFiIPService/locate.ashx

What this does is return a function, SetAutoLocateViewport, that you can use
with the MapControl.js VE Maps control. which can also be used to lookup the
city, state information.

SetAutoLocateViewport(28.5418, -81.3736, 10, false, 'Virtual Earth has
determined your location by using your computer\'s IP address.');

Note that the first two parameters represent the latitude and longitude of
the IPAddress represented by your REMOTE_HOST server variables.

Here's an article I did on this with more info (and a much smaller database,
in binary form as an embedded resource):

http://www.eggheadcafe.com/articles/20051109.asp

I am not familiar with how efficient their binary file lookup is, probably
the best way to find out is to ask the vendor. I suspect since they expect
high-volume usage that they've figured out how to optimize it.

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Fabuloussites" wrote:
I'm considering deploying an application that will us an IP address locaiton
database provided by Ip2location.com...

http://www.ip2location.net/ip2locati...component.aspx

their .net component reads data from a binary file. I'm guess i'm wondering
which 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 this
DB 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? Would
a high traffic webisite be able to use a serialized file efficiently if the
file was read often?

Thanks!

Jan 6 '06 #3
Thanks for the useful information. I was not aware of the localive service.
However, i've notice that i'm getting a consistent "Server currently busy,
Try again Later" message. Is there a commercial web service that will be
more reliable? Will this web service remain free?

thanks!
"Peter Bromberg [C# MVP]" wrote:
Actually,
you can get all this information for free without a database
by using the MSN Virtual Earth script generated by this URL:

http://local.live.com/WiFiIPService/locate.ashx

What this does is return a function, SetAutoLocateViewport, that you can use
with the MapControl.js VE Maps control. which can also be used to lookup the
city, state information.

SetAutoLocateViewport(28.5418, -81.3736, 10, false, 'Virtual Earth has
determined your location by using your computer\'s IP address.');

Note that the first two parameters represent the latitude and longitude of
the IPAddress represented by your REMOTE_HOST server variables.

Here's an article I did on this with more info (and a much smaller database,
in binary form as an embedded resource):

http://www.eggheadcafe.com/articles/20051109.asp

I am not familiar with how efficient their binary file lookup is, probably
the best way to find out is to ask the vendor. I suspect since they expect
high-volume usage that they've figured out how to optimize it.

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Fabuloussites" wrote:
I'm considering deploying an application that will us an IP address locaiton
database provided by Ip2location.com...

http://www.ip2location.net/ip2locati...component.aspx

their .net component reads data from a binary file. I'm guess i'm wondering
which 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 this
DB 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? Would
a high traffic webisite be able to use a serialized file efficiently if the
file was read often?

Thanks!

Jan 6 '06 #4

i found info on the live local service. Looks like it is still in beta
format.

http://download.microsoft.com/downlo...veLocalFAQ.doc

thanks for the info. i think i will try to get access to a sample database
and use your methods to make my own binary files. their component only works
with dot net 1.x and i want to use a 2.0 app.

thanks!
"Fabuloussites" wrote:
Thanks for the useful information. I was not aware of the localive service.
However, i've notice that i'm getting a consistent "Server currently busy,
Try again Later" message. Is there a commercial web service that will be
more reliable? Will this web service remain free?

thanks!
"Peter Bromberg [C# MVP]" wrote:
Actually,
you can get all this information for free without a database
by using the MSN Virtual Earth script generated by this URL:

http://local.live.com/WiFiIPService/locate.ashx

What this does is return a function, SetAutoLocateViewport, that you can use
with the MapControl.js VE Maps control. which can also be used to lookup the
city, state information.

SetAutoLocateViewport(28.5418, -81.3736, 10, false, 'Virtual Earth has
determined your location by using your computer\'s IP address.');

Note that the first two parameters represent the latitude and longitude of
the IPAddress represented by your REMOTE_HOST server variables.

Here's an article I did on this with more info (and a much smaller database,
in binary form as an embedded resource):

http://www.eggheadcafe.com/articles/20051109.asp

I am not familiar with how efficient their binary file lookup is, probably
the best way to find out is to ask the vendor. I suspect since they expect
high-volume usage that they've figured out how to optimize it.

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Fabuloussites" wrote:
I'm considering deploying an application that will us an IP address locaiton
database provided by Ip2location.com...

http://www.ip2location.net/ip2locati...component.aspx

their .net component reads data from a binary file. I'm guess i'm wondering
which 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 this
DB 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? Would
a high traffic webisite be able to use a serialized file efficiently if the
file was read often?

Thanks!

Jan 6 '06 #5
PJ
If it's only 27mb, why not just read the whole thing and put it in memory?

"Fabuloussites" <Fa***********@discussions.microsoft.com> wrote in message
news:D3**********************************@microsof t.com...
I'm considering deploying an application that will us an IP address
locaiton
database provided by Ip2location.com...

http://www.ip2location.net/ip2locati...component.aspx

their .net component reads data from a binary file. I'm guess i'm
wondering
which 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 this
DB 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?
Would
a high traffic webisite be able to use a serialized file efficiently if
the
file was read often?

Thanks!

Jan 7 '06 #6
As mentioned before, i'm really new to this type of situation. So, i was
just trying to get some input regaring the performance of using a binary
file, vs a SQL server.

"PJ" wrote:
If it's only 27mb, why not just read the whole thing and put it in memory?

"Fabuloussites" <Fa***********@discussions.microsoft.com> wrote in message
news:D3**********************************@microsof t.com...
I'm considering deploying an application that will us an IP address
locaiton
database provided by Ip2location.com...

http://www.ip2location.net/ip2locati...component.aspx

their .net component reads data from a binary file. I'm guess i'm
wondering
which 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 this
DB 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?
Would
a high traffic webisite be able to use a serialized file efficiently if
the
file was read often?

Thanks!


Jan 7 '06 #7
PJ
either way it's a wash if you just cache the information and code something
to update the cache every....what....day? how often does city state
information change?
"Fabuloussites" <Fa***********@discussions.microsoft.com> wrote in message
news:83**********************************@microsof t.com...
As mentioned before, i'm really new to this type of situation. So, i was
just trying to get some input regaring the performance of using a binary
file, vs a SQL server.

"PJ" wrote:
If it's only 27mb, why not just read the whole thing and put it in
memory?

"Fabuloussites" <Fa***********@discussions.microsoft.com> wrote in
message
news:D3**********************************@microsof t.com...
> I'm considering deploying an application that will us an IP address
> locaiton
> database provided by Ip2location.com...
>
> http://www.ip2location.net/ip2locati...component.aspx
>
> their .net component reads data from a binary file. I'm guess i'm
> wondering
> which 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
> this
> DB 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?
> Would
> a high traffic webisite be able to use a serialized file efficiently if
> the
> file was read often?
>
> Thanks!


Jan 7 '06 #8
I see you point. my concern is that i'm going to query this data for every
visitor to the website to determine what content to show them. So, this info
will be queried when a user first visits the site to obtain the city/state
info and store it in a cookie or something. So, i was not sure how accessing
1.8 million rows of data would impact the performace if the site had high
traffic.

"PJ" wrote:
either way it's a wash if you just cache the information and code something
to update the cache every....what....day? how often does city state
information change?
"Fabuloussites" <Fa***********@discussions.microsoft.com> wrote in message
news:83**********************************@microsof t.com...
As mentioned before, i'm really new to this type of situation. So, i was
just trying to get some input regaring the performance of using a binary
file, vs a SQL server.

"PJ" wrote:
If it's only 27mb, why not just read the whole thing and put it in
memory?

"Fabuloussites" <Fa***********@discussions.microsoft.com> wrote in
message
news:D3**********************************@microsof t.com...
> I'm considering deploying an application that will us an IP address
> locaiton
> database provided by Ip2location.com...
>
> http://www.ip2location.net/ip2locati...component.aspx
>
> their .net component reads data from a binary file. I'm guess i'm
> wondering
> which 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
> this
> DB 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?
> Would
> a high traffic webisite be able to use a serialized file efficiently if
> the
> file was read often?
>
> Thanks!


Jan 7 '06 #9

A properly setup database will perform better, I believe.

But testing is the only way to check for sure.

...

You need to properly index the table, esp with that many rows.

The addage of "if the column is in the where clause, then index it" may
not be sufficient here. You need to determine the exact query usage.

www.sqlservercentral.com would be a good resource for that kind of sql
server performance question.
Fabuloussites wrote:
I'm considering deploying an application that will us an IP address locaiton
database provided by Ip2location.com...

http://www.ip2location.net/ip2locati...component.aspx

their .net component reads data from a binary file. I'm guess i'm wondering
which 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 this
DB 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? Would
a high traffic webisite be able to use a serialized file efficiently if the
file was read often?

Thanks!


Jan 7 '06 #10
However, i've notice that i'm getting a consistent "Server currently busy,
Try again Later" message. Is there a commercial web service that will be
more reliable? Will this web service remain free?
You need to use the https location, and not the http one.
I had the same problem when trying to write a replacement for the activex control on linux, so i ended up with this prototype:
Expand|Select|Wrap|Line Numbers
  1. #!/bin/sh
  2. #
  3. # local.live.com's "locate me" 4 linux
  4. # 2006-03-19:jpa: i'like one liners...
  5. GET `iwlist scan 2>/dev/null |fgrep -e Address -e ESSID -e Quality|perl -e 'print "https://local.live.com/locate.ashx?pos="; my $mac, $level ; while(<>){chomp; if(/.*Address: (.*)/) { $mac = $1;} if(/.*level=(.*) dBm/){ $level=$1; print "$mac^^$level|";}; }; print "\n";'`|sed -n 's/.*(\([^,]*\),[ ]*\([^,]*\),.*/\1,\2/p'
  6. echo
  7.  
--
jpa
Mar 19 '06 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Sebastian Kemi | last post by:
How should a write a class to a file? Would this example work: object *myobject = 0; tfile.write(reinterpret_cast<char *>(myobject), sizeof(*object)); / sebek
2
by: kevininstructor | last post by:
I created two classes called "site" and "Sites" which use 'BinaryFormatter' to load and save class information to a disk file. In my test application all works fine but when implementing into...
5
by: Geo | last post by:
Hi, Im running into a strange problem here! I have created a linked server on one of my SQL Servers (local server). Lets call the linked server as LS1. I have an sproc which resides on the...
3
by: Lance | last post by:
Is there any way to determine the type of an object that is stored as a serialized file without deserializing the entire file? If possible, I'm interested in being able to do this for both binary...
7
by: John Dann | last post by:
I'm trying to read some binary data from a file created by another program. I know the binary file format but can't change or control the format. The binary data is organised such that it should...
2
by: gauravkhanna | last post by:
Hi All I need some help for the below problem: Scenario We need to send large binary files (audio file of about 10 MB or so) from the client machine (.Net Windows based application, located...
0
by: David Purton | last post by:
Hi, I have some ASP code to stream a binary file. It works well and looks something like the original ASP code shown below. I'm experimenting in creating ZIP files on the fly and am trying to...
3
by: MMiGG | last post by:
Hi Our project need parse JAVA serialized object string in C, has any library? Thanx
3
by: sebastian.harko | last post by:
Helllo, What's the general accepted strategy for dealing with very large binary files in C# ? I have to do a program that reads some "multi frame bitmap " files which can reach up to one...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.