New-age Transactional Systems - Not Your Grandpa's OLTP
John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.
The content has been bookmarked!
There was an error bookmarking this content! Please retry.
Posted by Werner Schuster on Jan 24, 2010
It's easy to annoy a Python developer: complain about significant whitespace in the language or point out the Global Interpreter Lock (GIL) which restricts the interpreter to running only one Python thread at a time.
With the advent of multicore systems, the GIL has come under even more fire. Dave Beazley's talk on the GIL explains the problems in detail (PDF Warning). It shows how the implementation of the GIL manages to slow down multithreaded Python programs due to bad interactions between the Python GIL and OS thread scheduling.
In short, the Python interpreter runs a thread for a certain amount of ticks (executed bytecode instructions); then it signals a condition variable that wakes up other threads which now have a chance to grab the GIL. On multicore or SMP systems, the original thread keeps running and also competes for the GIL - which poses a problem: the threads waiting for the condition variable's signal needs to be woken up before they can grab the GIL. Waking up a thread takes a bit of time - and often that's long enough to allow the thread that just released the GIL to be quicker and re-acquire the GIL. The effect: waiting threads keep getting awoken over and over trying to grab the GIL, only to be beaten to the punch by the already running thread.
The current Python trunk, which will become Python 3.2, contains a new algorithm, by Antoine Pitrou, where scheduling is based on time slices instead of ticks. Dave Beazley explains the new GIL algorithm and the tweaks that make it fairer and avoid the problems of the old approach.
A complete removal of the GIL was an item on the original todo list of the Unladen Swallow project, which has recently submitted PEP-3146: "Merging Unladen Swallow into CPython".
The GIL is also a problem in some Ruby implementations, mainly Ruby 1.9. However, JRuby, IronRuby, and even MacRuby, which was originally based on Ruby 1.9, allow parallel execution of Ruby threads.
Squeak, an open source Smalltalk, has been available for the iPhone for a while, and now Squeak has been ported to Android. The project is still at an early stage, but some of the details of the port are worth mentioning: Squeak on Android's only really possible because of Android's Native Development Kit (Android NDK), which allows to use native code in Android applications. With this, porting Squeak meant getting it to work with the ARM tool chain and porting some of the system integration to Android's flavor of Linux. Andreas Raab, who created the port, describes what's necessary to compile Squeak for Android.
A bigger problem is the current nature of Android NDK: it only interacts with Linux part of Android. Any Java-based Android libraries and APIs are not directly accessible - native code needs to route the calls through JNI and custom Java classes that perform the calls on behalf of the code. Another option can be seen in the Android Scripting Environment: Android APIs are exposed via JSON RPC. Native version of Python and Lua already use this method to access Android features with the ASE.
ASE's supported runtimes and ports like Squeak for Android also show something else: native versions of language runtimes, compiled using Android NDK, seem to be the quickest and most efficient way to bring languages runtimes to Android. While Android's Java based APIs seem to be a good argument for JVM based language implementations, they're limited by Dalvik VM, both by its execution efficiency and its use of a custom bytecodes instead of Java bytecodes.
More and more native language runtimes become available for Android, the already mentioned Python or Lua for Android, or Ruby for Android, are just a few examples.
Free Gartner Cloud Service Brokerage Report
Monitor your Production Java App - includes JMX! Low Overhead - Free download
Agile Practices to Improve Project Management Organization (PMO) Effectiveness
SOA All-In-One Guide: KPIs & Best Practices, ESB Report
Improve Java Garbage Collection, Runtime Execution, and JVM visibility with Zing
"The GIL is also a problem in some Ruby implementations, mainly Ruby 1.9. However, JRuby, IronRuby, and even MacRuby, which was originally based on Ruby 1.9, allow parallel execution of Ruby threads."
It should be pointed out that Jython and IronPython also allow parallel execution of threads, since they use the JVM/CLR thread models.
John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.
Kevlin Henney examines code samples to see what can be learned from them starting from the premise that one won’t write great code unless he knows how to read it.
Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.
Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).
Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.
Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.
One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.
InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.
1 comment
Watch Thread Reply