Jim Starkey wrote:
Brian Aker wrote:
H!

On Oct 13, 2008, at 12:01 AM, Roy Lyseng wrote:

You are misunderstanding me: What I mean is that when you have multiple threads running on behalf of a session, such as when you have multiple concurrent queries/statements running, then you need to synchronize more heavily on the session level.


You are right if you think about transaction context. The thing is most web shops, almost all, run in autocommit mode. This is the 80% case (if not more). Of course when you run within the context of a transaction you have an issue, I mentioned that in my original email, but the majority case does not do this. They fire off seven queries, get the results, and then build a page.


Gosh, Brian, that's a pretty good argument for an aggregating interface. Of course then they would have a single transaction and the results would even be consistent.


So the ultimate query interface for web apps is a way to execute an arbitrary number of arbitrary queries in a single roundtrip in autocommit mode. Running these queries in the context of a single session and transaction makes it possible to give guarantees about data consistency (I guess Ebay and Amazon will like this).

And of course these should be prepared statements. Bye-bye SQL injection problem... Implement a client-side statement pool if you prefer to deal with SQL text strings.

This would be (as far as I know) an extension to existing interfaces. The batched statements familiar from ODBC and JDBC is rather similar to this, but does allow only a fixed set of queries per roundtrip.

Another question is whether to run this synchronously or not, seen from the client. Aggregating all queries into one roundtrip by itself gives a great performance gain. I am not sure that implementing a complex asynchronous interface for receiving query results will add significantly to the performance. And the server is free to execute the queries received in a roundtrip concurrently.

Thanks,
Roy

_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to