Django style model for boto

9 views
Skip to first unread message

Travis Reeder

unread,
Jan 4, 2009, 3:30:43 PM1/4/09
to boto-users
I'm a java guy and just getting my feet wet with python (really
digging it), but would like to see more object oriented support for
SimpleDB. And since Django doesn't have any immediate plans to
support SimpleDB (or any other new school data store), I'm wondering
what it would take to add support to boto with almost the exact same
semantics, but obviously simplified since SimpleDB does not require a
lot of the stuff that a RDMBS would require.

I created a Java Persistence API implementation for SimpleDB called
SimpleJPA that is similar to the Django model stuff, but java style.
Just makes everything so much easier and quicker.
http://code.google.com/p/simplejpa/

Travis

Patrick Altman

unread,
Jan 4, 2009, 3:57:13 PM1/4/09
to boto-...@googlegroups.com
Why not start a new project doing the same in python and just wrap the
boyo library simpledb code?

---
Patrick Altman
(615) 300-2930

[Sent from my iPhone]

Chris Moyer

unread,
Jan 4, 2009, 4:01:47 PM1/4/09
to boto-...@googlegroups.com
We already have a boto.sdb.db persistence layer which does almost
exactly what Django does. It's actually closely modeled after the
Google Appengine DB layer. I've also create a project
(http://marajo.googlecode.com) which uses this persistence layer to
create a django-like webapp. I'm currently working on a re-design of
that called boto_web (http://boto-web.googlecode.com) which acts more
like an n-tier system.
--
Chris Moyer
Cloud Engineer, CloudRight
http://cloudright.com/

mitch

unread,
Jan 4, 2009, 4:14:52 PM1/4/09
to boto-users
Yeah, originally I wrote the boto.sdb.persist module described here:

http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1367&categoryID=176

but then later, after Google AppEngine appeared and had a similar
persistence layer, we created the boto.sdb.db module and modeled it
after Google's db module. We actually use it a lot and have
production systems running with it but it's not very well documented
at this time, other than the Google db docs of course. The
boto.sdb.persist module is still there but not actively developed.

Before I started either of those projects my first thought was to add
SimpleDB support to Django. But, after spending a few hours trying to
work my way through the code it didn't seem like it was going to fit
all that well but I'm by no means a Django expert.

Mitch

On Jan 4, 4:01 pm, "Chris Moyer" <koper...@gmail.com> wrote:
> We already have a boto.sdb.db persistence layer which does almost
> exactly what Django does. It's actually closely modeled after the
> Google Appengine DB layer. I've also create a project
> (http://marajo.googlecode.com) which uses this persistence layer to
> create a django-like webapp. I'm currently working on a re-design of
> that called boto_web (http://boto-web.googlecode.com) which acts more
> like an n-tier system.
>
>
>
> On Sun, Jan 4, 2009 at 3:57 PM, Patrick Altman <palt...@gmail.com> wrote:
>
> > Why not start a new project doing the same in python and just wrap the
> > boyo library simpledb code?
>
> > ---
> > Patrick Altman
> > (615) 300-2930
>
> > [Sent from my iPhone]
>

Travis Reeder

unread,
Jan 4, 2009, 4:21:25 PM1/4/09
to boto-...@googlegroups.com
Ahh, perfect.  I'll check it out.

Travis

Mitchell Garnaat

unread,
Jan 4, 2009, 4:40:54 PM1/4/09
to boto-...@googlegroups.com
I'll try to write a little intro on the wiki.  It's probably going to be hard to bootstrap without at least a little documentation.

Mitch

Travis Reeder

unread,
Jan 4, 2009, 7:20:00 PM1/4/09
to boto-...@googlegroups.com
That would be great. Thanks.

Travis

Carlos Pero

unread,
Feb 8, 2009, 10:48:40 AM2/8/09
to boto-users
Hi Mitch,

I'm looking forward to digging into boto.sdb. Have you written up
this bootstrap docs for sdb.db yet? I can't seem to locate any.

(I'm about to dig into the api docs to try to make a go of it
)

On Jan 4, 3:40 pm, "Mitchell Garnaat" <mitch.garn...@gmail.com> wrote:
> I'll try to write a little intro on the wiki.  It's probably going to be
> hard to bootstrap without at least a little documentation.
>
> Mitch
>
> On Sun, Jan 4, 2009 at 4:21 PM, Travis Reeder <tree...@gmail.com> wrote:
> > Ahh, perfect.  I'll check it out.
> > Travis
>
> > On Sun, Jan 4, 2009 at 1:01 PM, Chris Moyer <koper...@gmail.com> wrote:
>
> >> We already have a boto.sdb.db persistence layer which does almost
> >> exactly what Django does. It's actually closely modeled after the
> >> Google Appengine DB layer. I've also create a project
> >> (http://marajo.googlecode.com) which uses this persistence layer to
> >> create a django-like webapp. I'm currently working on a re-design of
> >> that called boto_web (http://boto-web.googlecode.com) which acts more
> >> like an n-tier system.
>
> >> On Sun, Jan 4, 2009 at 3:57 PM, Patrick Altman <palt...@gmail.com> wrote:
>
> >> > Why not start a new project doing the same in python and just wrap the
> >> > boyo library simpledb code?
>
> >> > ---
> >> > Patrick Altman
> >> > (615) 300-2930
>
> >> > [Sent from my iPhone]
>

Waldemar Kornewald

unread,
Feb 10, 2009, 5:10:59 AM2/10/09
to boto-...@googlegroups.com
BTW, what about making a real port of Django's Model? Maybe Django 1.2
will provide modular query backends, so the API could at least stay as
similar as possible and maybe simple Django apps would work
out-of-the-box. Would also make it easier to migrate between cloud
providers with similar restrictions. :)

Bye,
Waldemar Kornewald

Chris Moyer

unread,
Feb 10, 2009, 10:20:09 AM2/10/09
to boto-...@googlegroups.com
boto.sdb.db was meant to be more a copy of Google's appengine, not
Django (but they are very similar). At the time GAE was pulling a lot
more attention then Django was so that's where that was going. While
we could make the Model stuff work exactly like Django, there are
other restrictions that Django uses that simply wont work (like how
they handle sessions), so I'm not sure how useful that would be if
you're trying to just get Django to be more cloud-friendly.
--
Chris Moyer

Waldemar Kornewald

unread,
Feb 10, 2009, 10:26:29 AM2/10/09
to boto-...@googlegroups.com
Hi Chris,

On Tue, Feb 10, 2009 at 4:20 PM, Chris Moyer <kope...@gmail.com> wrote:
> boto.sdb.db was meant to be more a copy of Google's appengine, not
> Django (but they are very similar). At the time GAE was pulling a lot
> more attention then Django was so that's where that was going. While
> we could make the Model stuff work exactly like Django, there are
> other restrictions that Django uses that simply wont work (like how
> they handle sessions), so I'm not sure how useful that would be if
> you're trying to just get Django to be more cloud-friendly.

Why do you think that sessions won't work? I don't see any special
feature that would prevent them from working. In the worst case one
can write a custom backend. The biggest problem with SimpleDB is
eventual consistency, but that doesn't necessarily have to affect
sessions.

At least, I thought it would be possible to configure the
load-balancer such that a user always gets handled by the same web
server and the web server always gets handled by the same SimpleDB
node. Or is that not possible?

Bye,
Waldemar Kornewald

Chris Moyer

unread,
Feb 10, 2009, 10:28:57 AM2/10/09
to boto-...@googlegroups.com
From what I could tell, sessions in Django were stored locally, not in
the DB. That's very much a no-no in clustered systems. If you've got
it stored locally for one appserver, it wont be there when the user
connects to the other appserver.
--
Chris Moyer

Waldemar Kornewald

unread,
Feb 10, 2009, 10:35:18 AM2/10/09
to boto-...@googlegroups.com
On Tue, Feb 10, 2009 at 4:28 PM, Chris Moyer <kope...@gmail.com> wrote:
>
> From what I could tell, sessions in Django were stored locally, not in
> the DB. That's very much a no-no in clustered systems. If you've got
> it stored locally for one appserver, it wont be there when the user
> connects to the other appserver.

Actually, they're stored in the DB and you can choose/write different
backends like memcache, file system, and whatever you could imagine,
so that's definitely not a problem. Django is really flexible and I
think it would have many more advantages if Django could be used with
SimpleDB than writing a clone of App Engine's proprietary API. We
really need to work around vendor lock-in, so open-source APIs should
better be independent of any provider. How cool would it be if you
could move your Django app between SQL-based and cloud providers with
minimal or no modifications? :D

Bye,
Waldemar Kornewald

mitch

unread,
Feb 10, 2009, 7:38:04 PM2/10/09
to boto-users
I agree that would be a good thing. In fact, my very first attempt at
building an ORM-style system using SimpleDB was to try to integrate it
with Django. That was probably two years ago (I was in the private
beta for SimpleDB). At that time, it just didn't seem like there was
enough of an interface between Django and the underlying DB to wedge
SimpleDB in there. It sounds like that might have changed. If not,
I'm sure there are people out there who are much more familiar with
Django that I am.

I think it would be an awesome project and I'd certainly help as much
as I am able.

Mitch

On Feb 10, 10:35 am, Waldemar Kornewald <wkornew...@gmail.com> wrote:

Waldemar Kornewald

unread,
Feb 11, 2009, 8:10:47 AM2/11/09
to boto-...@googlegroups.com
Hi Mitch,

On Wed, Feb 11, 2009 at 1:38 AM, mitch <Mitch....@gmail.com> wrote:
> I agree that would be a good thing. In fact, my very first attempt at
> building an ORM-style system using SimpleDB was to try to integrate it
> with Django. That was probably two years ago (I was in the private
> beta for SimpleDB). At that time, it just didn't seem like there was
> enough of an interface between Django and the underlying DB to wedge
> SimpleDB in there. It sounds like that might have changed. If not,
> I'm sure there are people out there who are much more familiar with
> Django that I am.
>
> I think it would be an awesome project and I'd certainly help as much
> as I am able.

Cool. You could join the discussion here and add your view on what is
necessary to implement SimpleDB support or at least convince the
Django developers that a better backend API should get very high
priority on their task list:
http://groups.google.com/group/django-developers/browse_thread/thread/516626d18f6f3fca

Bye,
Waldemar Kornewald

Reply all
Reply to author
Forward
0 new messages