StorageService API

Cantor, Scott cantor.2 at osu.edu
Tue May 7 10:10:59 EDT 2013


On 5/7/13 9:59 AM, "Marvin S. Addison" <marvin.addison at gmail.com> wrote:
>
>I should note we saw deadlocks proper on Oracle, but with a frequency of
>a couple per month. On PostgreSQL, I got a daily deadlock report
>containing tens to hundreds of entries. Here's a thoughtful post on
>pgsql-general describing the situation in painful detail:
>
>http://www.postgresql.org/message-id/4C1A65F4.6050408@vt.edu

Yeah, that's just nuts.

>Yes, just reads and writes on the ticket registry. It's a mix of user
>(servlet container) threads and background cleanup threads. You can see
>from the post that some of the locking semantics arise from the database
>schema and could be alleviated by some schema tweaks, but the design is
>fairly common and the severity of problems arising from something so
>ordinary is indeed alarming.

That's not just common, it's a basic design for a SQL database.

>It's not solely total disk or tablespace size, but also size of
>individual LOB fields. In our case we're serializing a HashMap that
>grows linearly with the length of the CAS SSO session and in some cases
>it exceeded the limits of the BLOB type on MySQL. That puzzled a fair
>number of folks, though the fix was simple: use LONGBLOB.

Right, so for that kind of scenario, I would not necessarily expect that
you're serializing a hashmap. I'd have to see the requirements, but that's
the sort of thing I would use the API to manage, but creating, for
example, a context representing the "parent" record and then adding keys
for the children.

That takes advantage of the hashmap that's already built-in to the
in-memory implementation, and would look much like what your schema
already looks like in the database case.

>Combining into a single expirable key-value type seems even more
>problematic. Honestly, I think metadata annotations on the fields is the
>most flexible and least invasive solution, but that has a higher runtime
>cost. Still, I tend to favor those sorts of solutions unless there's
>clear evidence of a performance problem.

I'm not concerned about that cost, I just have no experience with
annotations. Is that something you might be able to throw some code
together as an example of?

-- Scott




More information about the dev mailing list