Hi Greg,
> From what I read Slick doesn't yet support optimistic locking or STM.
> Most of this info/articles related to Slick v1, not the
> new v2 series.
> Is that still true?
that is still true and it is our impression that these should be built
as libraries on top of Slick
> Are these on the roadmap?
Not at the moment. But we are primarily an open source project, not
primarily a commercial product (despite type-safe offering commercial
extensions and support) and open for contributions.
> Is Slick
> "slow" relative to other options that may have these
> features?
Slick is as fast as plain old JDBC. One additional cost is the time for
compiling Slick queries to SQL, but since you can cache them, that
overhead is constant per app instance. Also, the SQL the Slick compiler
generates is not in all cases optimized well enough by all dbms.
Especially with MySQL there are cases known where nested queries, which
Slick currently generates in some cases, stop MySQL from using indices
and lead to unnecessary table scans. In these cases you have to fall
back to hand-written SQL at the moment, but it is rather straight
forward to do so as Slick is used in the same way. More info on
http://slick.typesafe.com/doc/2.1.0/orm-to-slick.html
Also interesting
http://slick.typesafe.com/doc/2.1.0/sql-to-slick.html
> I've also looked at Activate, which looks really cool, but it yet
> support Scala 2.11.
I haven't used Activate, so anybody please correct me if I am wrong.
From what I understood, Activate uses an STM as a local cache. So if you
do modifications and they become obsolete by other modifications (e.g.
overwriting values multiple times or inserting rows and deleting them
within a short time) you don't actually need to write them to the
database and save some queries making you effectively faster than using
JDBC in these cases. However that is only true, if you manage to write
back the accumulated changes without conflicts. If you do happen to have
conflicting changes it may take longer, because transactions have to be
replayed on top of the changed situation. This can take longer or giving
unfortunate configuration and number of merge conflicts... forever in
the worst case. I suspect it depends on your actual access patterns and
application distribution if STM means a win or a loss for you. I may be
off here. I would love to hear more about this from someone who knows
for sure.
Chris