Linked by Thom Holwerda on Sat 11th May 2013 21:41 UTC
Windows "Windows is indeed slower than other operating systems in many scenarios, and the gap is worsening." That's one way to start an insider explanation of why Windows' performance isn't up to snuff. Written by someone who actually contributes code to the Windows NT kernel, the comment on Hacker News, later deleted but reposted with permission on Marc Bevand's blog, paints a very dreary picture of the state of Windows development. The root issue? Think of how Linux is developed, and you'll know the answer.
Permalink for comment 561632
To read all comments associated with this story, please click here.
RE[16]: Too funny
by satsujinka on Wed 15th May 2013 05:59 UTC in reply to "RE[15]: Too funny"
satsujinka
Member since:
2010-03-11

The difference is that normally databases aren't designed to have their datastores read/written by external processes as they're being used, so the problem doesn't really come up at all. Never the less I do want to point out that even for textual databases readers do need to be blocked and/or intercepted in order to prevent incomplete writes & incomplete transactions from being seen by the reader.


I guess, but in the case of a log this isn't really going to be an issue. And this also depends on whether or not reading incomplete transactions is an issue.

Another thing I should point out. I was rather purposefully using "query engine" before. Logs shouldn't be written to (by anything other than the logger,) so there won't be any writing being done by the database in the first place. It's just another read client (like the standard tools would be.)

If you don't have a database background, you might not realize that transactions can involve many non-contiguous records such that without locking you'd end up with a race condition between the reader / writer starting and completing their work in the wrong order.

Again, only if the reader cares what the writer is writing. In the case of a log, in which every record is only written once, this shouldn't be an issue.

In the absence of a confirmed bug report, my gut feeling is that the most likely cause of your problem was an uncommitted transaction. Maybe you deleted and queried the result *inside* one transaction, then from another program you still saw the original records. You wouldn't see the deletions until the first transaction was committed. This can surprise you if you aren't expecting it, but it makes sense once you think about it.

I wasn't doing the manipulations directly, however, I'm fairly certain that the delete was committed (since it was a single transaction spawned by a REST command.) I will admit that it may not have been entirely MS SQL Server's fault, but it was irritating enough that I'd really just rather have direct access to the data.

When you program in pl/sql, for example, by default all the changes you make (across many datatables and even schemas) remain uncommitted. You can execute one or more pl/sql programs & update statements from your IDE and then query the results, but until you hit the commit button, noone else can see your changes. The semantics of SQL guarantee that all those changes are committed atomically. It's understandable that awareness of these SQL concepts is low outside the realm of SQL practitioners given that they don't exist in conventional file systems nor programming languages.

I may not work with databases all the time, but I do have some experience; so I can pretty much guarantee that I don't have any issues with the commit/rollback functionality of databases (in point of fact, I've been trying to get approval to modify my employer's web server to not just commit everything it does right away; instead someone just decided that implementing a custom history was a good idea...)

The thing is, if your software supports logging into a database interface, you could have a simple NULL database engine that does absolutely nothing except output a text record into a text file. That's essentially a freebee for you.


This would be fine. The logs are in text and you can use SQL. That fits my requirements just fine.

The inverse is not true, processes that are developed to output to text files will need additional external scripts/jobs for parsing and inserting relational records into the database. Also there's a very real risk that the logging program will not log enough information to maintain full relational integrity because it wasn't designed with that use case in mind. Our after-the-fact import scripts are sometimes left to fuzzy matching records based on timestamps or whatnot. If the standard logging conventions dictated that programs used a structured database record format from the get go, such ambiguities wouldn't have arisen.


This is actually what I've been saying. The log should be structured in record format. CSV is a record format so that was the example I've been using (it has the added bonus of working with existing tools, but so long as the format can be read by humans I don't care.) The only additional requirement I have is that the record format should also be human readable.

Hell, the log could be an .sql file for all I care.

It's probably wishful thinking that all programs could shift to more structured logging at this point since we're already entrenched in the current way of doing things. But if we had it all to do over, it would make a lot of sense to give modern database concepts a more prominent primary role in our everyday operating systems.

I don't disagree with you. I do like the relational model, even if I'm not fond of SQL.

Reply Parent Score: 2