Concurrent PUTs?

8 views
Skip to first unread message

Dustin Whitney

unread,
Feb 3, 2009, 12:13:06 AM2/3/09
to Sublime SimpleDB
Hey, I found this the other day and thought I'd give it a spin. It's
pretty cool!

In your "select ("select * from test where role='reviewer'") foreach
( e => domain ("test") item (e) set ("score" -> "2"))"

example. Are those updates in the foreach done in parallel?

-Dustin

Robin

unread,
Feb 3, 2009, 3:13:35 AM2/3/09
to sublime-...@googlegroups.com
Glad you like it!

No, in that example, the updates would be done serially.  I do intend to address the issue of making requests in parallel, probably by making some kind of actor based pool of connections.  My priority has been to get the API and class structure into reasonable shape.  I am using it in a couple of applications, one of which will need to deal with load, and so concurrent connections are likely to be something I add soon.

Since I wrote that intro page, I have also added a simple type conversion mechanism and a DSL for writing simpleDB's Query language directly in typesafe scala rather than as strings:

Here are some examples (from a simple blog application):

    object PostingRecord {
        /** Attributes used in simpleDB **/
        val title = attribute("title")
        val author = attribute("author")
        val tags = attribute("tags")
        val date = attribute("date", ISO8610Date)        
    }
 
    // query for the index of postings
    def index = postings (((tags eq updateTag) intersection (date < new java.util.Date)) sort date desc)           

    def savePosting (postingAuthor:String, postingTitle:String, body:String) :String = {
         val key = java.util.UUID.randomUUID.toString
         (postings item key) += (
             author(postingAuthor), 
             title(postingTitle), 
             tags(updateTag), 
             date(new java.util.Date()))

         postingsFolder / key << body
         key
    }

-Robin

--
-Robin

Robin Barooah
http://www.sublime.org

Robin

unread,
Feb 3, 2009, 11:33:50 AM2/3/09
to sublime-...@googlegroups.com
Hopefully it goes without saying that I'm very interested in receiving feedback while it's at such an early stage and easy to change.

-Robin

Dustin Whitney

unread,
Feb 3, 2009, 11:35:19 AM2/3/09
to Sublime SimpleDB
What does this bit of code do?

postingsFolder / key << body

Is that "postingsFolder" on S3?

Also, where is body? I don't see that in the PostingRecord

-Dustin

Robin

unread,
Feb 3, 2009, 11:45:17 AM2/3/09
to sublime-...@googlegroups.com
On Tue, Feb 3, 2009 at 8:35 AM, Dustin Whitney <dustin....@gmail.com> wrote:

What does this bit of code do?

postingsFolder / key << body

Is that "postingsFolder" on S3?

Yes.  That is using a simple wrapper around jetS3t.
 

Also, where is body?  I don't see that in the PostingRecord

The bodies are stored on S3.  SimpleDB is only used for the index, since individual attributes are limited to 1024 bytes.
Reply all
Reply to author
Forward
0 new messages