Are you suggesting that using the same hardware but with good SQL
configuration I can expect the same speed writing transactionally to
SQL that I can writing to a text file with some decient programming
wrapped around it?
It is possible. I am not sure how much data you have a on a single row,
but I have worked on systems that performed millions of transactions a
day without the type of performance you are talking about.
Here are a couple of things I have thought about
1. Look at your insert method. It should be very lean. Example:
a) Load variables you are tracking into sql parameter objects
b) Instantiate connection and command with parameters
c) Fire off ExecuteNonQuery()
If you make hte insert lean (no LINQ, EF, DataSet/TableAdapter), things
will go much faster, esp. if the inserted database is just an insert and
you are not reporting off of it
2. Reduce the amount of information per insert
If you are inserting the same information over and over again for a
particular user, you can normalize the data a bit so you are merely
tracking new information. That is just one example.
Not knowing how you are inserting, I am not sure how much can be sped
up, but the thinner the data layer is, the faster it operates.
My gut feeling is that it would take good SQL configuration and better
hardware and it would be able to keep up but not be faster. If that's
the case I fail to see any big advantage in writing directly to SQL,
at least from a financial standpoint assuming the cost for SQL and
better hardware.
And this may be, in your particular case. The question is whether the
company spends money on better hardware and some code tweaks or it
spends it to have a logging mechanism built, along with some custom bulk
ETL software. The big question is whether they see your time as a fixed
cost or not.
I'm not trying to argue, but everyone seems to think I should solve my
problem using anything other than writing to a text file. I completly
agree that the process would require less programming and be easier to
accomplish if I was able to write directly to SQL, I'm just not
convinced it's the right solution.
I am going on my experience. I also have a lack of knowledge of the
particulars of your system, which I admit may be a stumbling block for
me. In general, I would not head the direction you are heading.
If buying additional hardware is out, it is a constraint you have to
live with. Perhaps thinning out data access will help SQL keep up, but
it might not. You always have the file log direction to head.
But, as you have already expressed, you will end up with a management
piece on top of the logger. The reason for this is you will have to
close out logs eventually to upload. And, as you have expressed, it
might be every couple of hours. If this is not automated , it can
consume a great deal of your time.
I've read many times that you shouldn't write your IIS logs directly
to SQL if you have a busy website because it's so much faster to write
them to the text file. My process seems to be very simular to IIS
logging.
It is, in some ways, but the process writing the IIS logs is optimized
for large logs. In addition, it sounds like your reporting needs are a
bit different.
I imagine you might be able to find some type of third party control
that can set aside space for a file and fill it in a non "line by line"
manner. I am not sure where you would search for that. It will end up as
a native Windows component.
Thank you again for your suggestions, I do appreciate it.
No problem. I enjoy hearing issues and problems and putting my head
around them. ;-)
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Twitter: @gbworld
Blog:
http://gregorybeamer.spaces.live.com
*******************************************
| Think outside the box! |
*******************************************