Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Flat files and ASP.NET

Reply
Thread Tools

Flat files and ASP.NET

 
 
=?Utf-8?B?TmF2YW5lZXRoLksuTg==?=
Guest
Posts: n/a
 
      08-30-2007
Hello

I am developing a system for user tracking. In this I am tracking all the
visitors that came to my website. i developed this using a HTTPModule and
storing the data in a SQL Server database. Everything worked fine till my
website gets good traffic.

When website is getting good traffic, this method is slowing down the entire
application. So I am planning to use flat files instead of SQL Server
database. My doubts are

1 - What is a flat file and how can I connect to it from my ASP.NET
application
2 - If multiple users are browsing website at same time, how can I save
data's to file, because that may be in use.
3 - Is XML files are normal flat files ?

Please help me on this issue.

Sincerly
Navaneeth
 
Reply With Quote
 
 
 
 
marss
Guest
Posts: n/a
 
      08-30-2007
On 30 , 10:06, Navaneeth.K.N
<(E-Mail Removed)> wrote:
> Hello
>
> I am developing a system for user tracking. In this I am tracking all the
> visitors that came to my website. i developed this using a HTTPModule and
> storing the data in a SQL Server database. Everything worked fine till my
> website gets good traffic.
>
> When website is getting good traffic, this method is slowing down the entire
> application. So I am planning to use flat files instead of SQL Server
> database. My doubts are
>
> 1 - What is a flat file and how can I connect to it from my ASP.NET
> application
> 2 - If multiple users are browsing website at same time, how can I save
> data's to file, because that may be in use.
> 3 - Is XML files are normal flat files ?
>
> Please help me on this issue.
>
> Sincerly
> Navaneeth


I have a doubt whether saving data to a file on the hard drive is
faster then saving data in the database. Not to mention the speed of
processing these data.

Regards,
Mykola
http://marss.co.ua

 
Reply With Quote
 
 
 
 
Mark Rae [MVP]
Guest
Posts: n/a
 
      08-30-2007
"Navaneeth.K.N" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> So I am planning to use flat files instead of SQL Server database.


??? Surely not...

> 2 - If multiple users are browsing website at same time, how can I save
> data's to file, because that may be in use.


You can't...

> 3 - Is XML files are normal flat files ?


XML files are text files, specifically designed as a lingua franca of data
transmission between different systems - they should not be used as a
substitute for a database...

You need to look at optimising your database and how you are connecting to
it - that's where the bottleneck is...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

 
Reply With Quote
 
Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
Guest
Posts: n/a
 
      08-30-2007
I suggest you stick with a database. Flat files will almost certainly not
give you additional speed or scalability.
Perhaps you could use some sort of a queue to save up log records and only
write to the database every so often.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net



"Navaneeth.K.N" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello
>
> I am developing a system for user tracking. In this I am tracking all the
> visitors that came to my website. i developed this using a HTTPModule and
> storing the data in a SQL Server database. Everything worked fine till my
> website gets good traffic.
>
> When website is getting good traffic, this method is slowing down the
> entire
> application. So I am planning to use flat files instead of SQL Server
> database. My doubts are
>
> 1 - What is a flat file and how can I connect to it from my ASP.NET
> application
> 2 - If multiple users are browsing website at same time, how can I save
> data's to file, because that may be in use.
> 3 - Is XML files are normal flat files ?
>
> Please help me on this issue.
>
> Sincerly
> Navaneeth


 
Reply With Quote
 
Aidy
Guest
Posts: n/a
 
      08-30-2007
Yes, the OP could look into MSMQ, however what levels of traffic are we
talking here? If it isn't extremely heavy I can't understand why SQL would
be causing a bottleneck. I'd look into what is causing the delay before
looking for an alternative solution.

"Steve C. Orr [MCSD, MVP, CSM, ASP Insider]" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
>I suggest you stick with a database. Flat files will almost certainly not
>give you additional speed or scalability.
> Perhaps you could use some sort of a queue to save up log records and only
> write to the database every so often.
>
> --
> I hope this helps,
> Steve C. Orr,
> MCSD, MVP, CSM, ASPInsider
> http://SteveOrr.net
>
>
>
> "Navaneeth.K.N" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hello
>>
>> I am developing a system for user tracking. In this I am tracking all the
>> visitors that came to my website. i developed this using a HTTPModule and
>> storing the data in a SQL Server database. Everything worked fine till my
>> website gets good traffic.
>>
>> When website is getting good traffic, this method is slowing down the
>> entire
>> application. So I am planning to use flat files instead of SQL Server
>> database. My doubts are
>>
>> 1 - What is a flat file and how can I connect to it from my ASP.NET
>> application
>> 2 - If multiple users are browsing website at same time, how can I save
>> data's to file, because that may be in use.
>> 3 - Is XML files are normal flat files ?
>>
>> Please help me on this issue.
>>
>> Sincerly
>> Navaneeth

>



 
Reply With Quote
 
Mark Rae [MVP]
Guest
Posts: n/a
 
      08-30-2007
"Aidy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> If it isn't extremely heavy I can't understand why SQL would be causing a
> bottleneck.


Could be any number of reasons: poor design, no primary key / index,
inefficient use of ADO.NET, not closing connections etc...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

 
Reply With Quote
 
Aidy
Guest
Posts: n/a
 
      08-30-2007
> Could be any number of reasons: poor design, no primary key / index,
> inefficient use of ADO.NET, not closing connections etc...


That's what I meant, I don't see that it can be SQL Server's fault but
something to do with the design/coding.

BTW, why would not having an index *harm* insert performance?


 
Reply With Quote
 
John Timney \(MVP\)
Guest
Posts: n/a
 
      08-30-2007
A flat file likely won't help you - ultimately your database does nothing
more than write data to a file. XML is not he right approach either.

You need to either change your approach to tracking data, using perhaps a
hidden iframe in you pages that impacts a second web server instead of your
primary - or look to scale out for load by adding web servers to create a
farm.

Ultimately, a fix is a design decision as your problem could be in the
module rather than he fact that your talking to a database, you could try to
spawn your write activities off to asynchronous threads and see if it
reduces your problems or simply load your data into the application object
and every 1000 requests or so write it to the DB.

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog


"Navaneeth.K.N" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello
>
> I am developing a system for user tracking. In this I am tracking all the
> visitors that came to my website. i developed this using a HTTPModule and
> storing the data in a SQL Server database. Everything worked fine till my
> website gets good traffic.
>
> When website is getting good traffic, this method is slowing down the
> entire
> application. So I am planning to use flat files instead of SQL Server
> database. My doubts are
>
> 1 - What is a flat file and how can I connect to it from my ASP.NET
> application
> 2 - If multiple users are browsing website at same time, how can I save
> data's to file, because that may be in use.
> 3 - Is XML files are normal flat files ?
>
> Please help me on this issue.
>
> Sincerly
> Navaneeth



 
Reply With Quote
 
Mark Rae [MVP]
Guest
Posts: n/a
 
      08-30-2007
"Aidy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> BTW, why would not having an index *harm* insert performance?





--
Mark Rae
ASP.NET MVP
http://www.markrae.net

 
Reply With Quote
 
Niels Ull
Guest
Posts: n/a
 
      08-30-2007
> Yes, the OP could look into MSMQ, however what levels of traffic are
> we talking here? If it isn't extremely heavy I can't understand why
> SQL would be causing a bottleneck. I'd look into what is causing the
> delay before looking for an alternative solution.


I definitely concur with analysing before fixing.

However, it is very likely that a suitably buffered flat file writer will
be faster than committing individual log entries to a database.

Each thread could have its own buffered logger which only flushed to a common
synchronized disk file logger when the buffer is full.
If log entries are timestamped, the ordering of log messages are not important.

Of course, this does run the risk of data loss in case of system failure.

If it is undesirable to have even small waits when flushing to the synchronized
logger, the logger could also be buffered with a separate thread to flush
it to disk.

MSMQ does seem like a bit overkill here, unlesss you really need transactional
support, distribution etc.

XML is not a very suitable format for log files, since they require all content
to be wrapped in a single element. It would, however,
be possible to have a log file containing lots of xml fragments.

Good luck!

Niels


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Webinar: Exploiting EDI and Flat Files in an XML World Stylus Studio XML 0 10-26-2007 03:40 PM
sql simulation with jsp/jdbc and flat files MyClue Java 5 07-05-2006 08:13 PM
XML Not good for Big Files (vs Flat Files) Homer Java 230 05-01-2006 07:46 PM
Re: Working with flat files [LDIF]. generate@gmail.com Python 2 01-07-2005 02:26 AM
Flat unstructured log files to XML hakhan XML 0 10-19-2004 11:50 AM



Advertisments