Sample application: a blog engine

98 views
Skip to first unread message

Guillaume Laforge

unread,
Aug 8, 2011, 10:40:44 AM8/8/11
to gae...@googlegroups.com
Hi all,

I worked a bit on a sample application for Gaelyk, that would be a real app rather than just a mere small sample.

It's a blog application engine, called bloogaey, and whose sources you can find on GitHub:

I've started migrating my own blog articles to a deployment of bloogaey here:

You can learn a bit about the various libraries used for that application here:

It's a mono-user application, in the sense that it's the administrator of the GAE app that is the only one allowed to post to this blog.
There's a wysiwyg editor for the blog post.
It's using the blobstore to store pictures.
Your articles and posts can be put in multiple categories.
There's a page for harvesting my twitter tweets, google reader shared articles, and my saved bookmarks on delicious.
The search is powered by Google Custom Search Engine, and the commenting system is from IntenseDebate.T
The engine is using the Gaelyk caching (through the URL routing system) to cache content for faster serving.
You can subscribed to the atom feed for the whole site or for categories you're interested in.

There are several improvements I could think of (like support for pingbacks/trackbacks, an XMLRPC interface for blogging clients, support for posting by email like on posterous and such, etc.), it's also not tested (but manually), but at least, that's a start, and you can already have some fun with this application.

I'll soon migrate my old php blog to this app.

I'm happy to talk with you of further improvements, and even accept pull requests, since it's hosted on GitHub :-)

--
Guillaume Laforge
Groovy Project Manager
Head of Groovy Development at SpringSource
http://www.springsource.com/g2one

Twitter: @glaforge

Nestor Guendolay

unread,
Aug 8, 2011, 1:02:11 PM8/8/11
to gae...@googlegroups.com
Thanks a lot to share this engine

Regards
David

--
You've received this message because you've subscribed to the Gaelyk Google Group.
To send an email to the group, please write to: gae...@googlegroups.com
To unsuscribe from this group: gaelyk+un...@googlegroups.com
To show more options: http://groups.google.fr/group/gaelyk?hl=en

Mohammed Sanaulla

unread,
Aug 8, 2011, 2:04:37 PM8/8/11
to gae...@googlegroups.com
Thanks a lot Guillaume. That's awesome. Let me take some time to understand the code. This would be a major learning :)

One thing I noticed- You have categorised the tweets date wise- I dont think there's an API from twitter to do  this? And have you pre configured that the tweets from last 15 days from current day be shown?
(Sorry for going off topic, may be if this idea is something not common, it can be documented in the wiki of the github project. And I havent yet gone through the code to find out how this is being done)

Mohamed Sanaulla | http://in.linkedin.com/in/mohamedsanaulla


Sebastien Blanc

unread,
Aug 8, 2011, 2:15:45 PM8/8/11
to gae...@googlegroups.com
Wow, I think I just found my new blog reactor !!

Guillaume Laforge

unread,
Aug 8, 2011, 3:30:10 PM8/8/11
to gae...@googlegroups.com
The code should tell you everything you need :-)


I fetch all the tweets, reader links, delicious bookrmarks, put them in a list, and sort everything by date.

Guillaume

derdickemax

unread,
Aug 9, 2011, 6:58:50 AM8/9/11
to Gaelyk
> I worked a bit on a sample application for Gaelyk, that would be a real app
> rather than just a mere small sample.

> It's a *blog application* engine, called *bloogaey*, and whose sources you
> can find on *GitHub*:https://github.com/glaforge/bloogaey

Super! Merci!!

> I've started migrating my own blog articles to a deployment of bloogaey
> here: http://glaforge.appspot.com/

Cool design.
Lightweight but appealing.
If You loose Your job as developer You can work as a webdesigner ;-)

Chris Boldon

unread,
Aug 9, 2011, 12:53:45 PM8/9/11
to gae...@googlegroups.com
Thanks for the great work!

A quick question there. I see that your blog content is over 500 characters in many instances. Whenever I try to save something longer than 500 characters, I have to expressly declare its type as Text (com.google.appengine.api.datastore.Text), else i get an error that it cannot be saved. I don't see you doing this in the example. Am I missing something?

Thanks,
Chris

On Mon, Aug 8, 2011 at 9:40 AM, Guillaume Laforge <glaf...@gmail.com> wrote:

Guillaume Laforge

unread,
Aug 9, 2011, 1:05:36 PM8/9/11
to gae...@googlegroups.com
Hi Chris,

That's a "new feature" in Gaelyk 1.0, that I actually mentioned in the release notes, on the download page.
Gaelyk handles that conversion transparently for you.
So when you save some text with myEntity = someText, Gaelyk will create a Text instance if the text is longer than 500, or simply use a string otherwise. Same thing for retrieving the value: if Gaelyk sees it's a Text, it'll give you back a String instead automatically.
It makes things more transparent.
If you still want to handle String vs Text manually, you can still use the get/set property methods on Entity directly.

Guillaume

Kunal

unread,
Aug 9, 2011, 2:14:43 PM8/9/11
to gae...@googlegroups.com
One thing in particular that caught my attention and feels best about this blog engine is its blazing fast. I never experienced such responsiveness for groovy/gaelyk apps.

I checked source, seems to be caching magic in routes. But how are you escaping the inevitable cold starts for such a new app (app id)? Is that because an url of this app is dzone'd and because of constant requests traffic the instance is always 'hot'?

If its just because of caching routes, that would just save loading and execution of groovlet/template servlet on startup. That means, groovlet/template servlet are real cause of cold start time in gaelyk app? As I last observed, a barebone java app with servlet and jsp take about 1000 cpu ms while similar gaelyk app takes about 6000cpu ms to start.

Guillaume Laforge

unread,
Aug 9, 2011, 2:32:54 PM8/9/11
to gae...@googlegroups.com
Hi,

On Tue, Aug 9, 2011 at 20:14, Kunal <kunal...@gmail.com> wrote:
One thing in particular that caught my attention and feels best about this blog engine is its blazing fast. I never experienced such responsiveness for groovy/gaelyk apps.

I checked source, seems to be caching magic in routes.

Caching is indeed key here :-)
 
But how are you escaping the inevitable cold starts for such a new app (app id)? Is that because an url of this app is dzone'd and because of constant requests traffic the instance is always 'hot'?

With the DZone trafic and twitter, etc, plus the inevitable search engine bots harvesting the site, there's almost always one instance turned on, so that instance is hot. 
I had a peak of 5 instances when the flood of DZone links came in.
 
If its just because of caching routes, that would just save loading and execution of groovlet/template servlet on startup.

What's nice with caching is that even when an instance cold starts, the cached output can still be there in memcache (as it doesn't have the same lifecycle as the instances), so Gaelyk doesn't have to re-parse and re-compile all the controllers and views, so it's faster than a pure restart without any caching going on.
 
That means, groovlet/template servlet are real cause of cold start time in gaelyk app? As I last observed, a barebone java app with servlet and jsp take about 1000 cpu ms while similar gaelyk app takes about 6000cpu ms to start.

From my logs, I see that cold starts can be between 3 and 6 seconds, so it's obviously less ideal that a pure servlet / jsp app.
At some point I think I'll have a closer look to see if I can shave some time off here, but it's not only Gaelyk, it's also Groovy at play here.

Obviously, there's also the "always on" option, and soon, you'll be able to push some knobs to say how recycling of instances should be working.
So it'll be less important as you can tweak your configuration.

Now I also wished that the servers they use were a bit faster, because it always feels like twice as slow as a poor 3-years-old laptop :-O

Seymores

unread,
Aug 9, 2011, 10:24:17 PM8/9/11
to Gaelyk
Hi Guillaume,

I'm interested to know -- with the DZone spike and high traffic, do
you get to pay google at all?
:-)

On Aug 10, 2:32 am, Guillaume Laforge <glafo...@gmail.com> wrote:
> Hi,
>
> Head of Groovy Development at SpringSourcehttp://www.springsource.com/g2one

Guillaume Laforge

unread,
Aug 10, 2011, 2:03:27 AM8/10/11
to gae...@googlegroups.com
Nope. Nothing to pay at all.
I'm still pretty far from the free limits.
Despite reaching up to 5 instances at a peak of 2 request per seconds.
But that was really just a short peak in time anyway.
With caching being used, I really don't expect to pay Google.

Guillaume

Reply all
Reply to author
Forward
0 new messages