The guys over at SpringSource have created an "Application Platform" based on Tomcat, Spring, and OSGI. Interesting stuff, read more at InfoQ.
I'm gonna get my hands on the beta. Though if they intend to release it as Open Source anyway, why is there a beta sign up? Odd...
Wednesday, April 30, 2008
Wednesday, April 16, 2008
Mastering Grails
Scott Davis has posted "Mastering Grails: Many-to-many relationships with a dollop of Ajax" in the Mastering Grails series. If anyone can master Grails; it would be Scott Davis. Have a look.
Tuesday, April 15, 2008
Spring Security 2.0 Released
Spring Security 2.0 has been released into the wild. Tons of great new features, including OpenId Support!
http://www.springframework.org/node/627
http://forum.springframework.org/showthread.php?t=52640
http://www.nabble.com/-ANN--Spring-Security-2.0.0-Released-to16701081.html
http://www.springframework.org/node/627
http://forum.springframework.org/showthread.php?t=52640
http://www.nabble.com/-ANN--Spring-Security-2.0.0-Released-to16701081.html
Thursday, March 13, 2008
Hibernate and Memcached
As I mentioned at the end of my last post, Cache Everything, I am working on building a library to use memcached from Hibernate as a second level cache. That project is hibernate-memcached and its in it's infancy over at googlecode.
The Hibernate second level cache is used to cache items between session invocations. Hibernate always uses it's session as a first level cache, but if you want to avoid database hits between sessions you need a second level cache. If you want these caches to stay in synch between several instances of your application, you need a distributed second level cache.
Memcached is a fantastically fast distributed cache, so why not use that? Once I build a jar of the hibernate-memcached project you'll be able to include it in your application and tell Hibernate to use it. Telling Hibernate to use it means adding the cache_provider property to your hibernate.cfg.xml, or your Spring LocalSessionFactoryBean if you're using that. The hiberante.cfg.xml looks like this...
Then, in your mappings you tell Hibernate that you want instances of your persistent objects to be cached, or collections from relation ships to be cached. Once Hibernate knows what you want cached you can watch it pump stuff into memcached, which is good clean geeky fun. Fire up memcahed (on windows or linux) using the -vv command line option to make it run "very verbose". You can see it storing and responding for each operation taken.
You can play with the code straight out of subversion at google code. It will actually work and cache stuff, but it is currently hardcoded to look only at localhost:11211 for a memcached instance. I'll get around to making it configurable. To build the code you'll need Maven2. I highly recommend using Don Brown's no-suck port of maven2 actually.
More to come...
The Hibernate second level cache is used to cache items between session invocations. Hibernate always uses it's session as a first level cache, but if you want to avoid database hits between sessions you need a second level cache. If you want these caches to stay in synch between several instances of your application, you need a distributed second level cache.
Memcached is a fantastically fast distributed cache, so why not use that? Once I build a jar of the hibernate-memcached project you'll be able to include it in your application and tell Hibernate to use it. Telling Hibernate to use it means adding the cache_provider property to your hibernate.cfg.xml, or your Spring LocalSessionFactoryBean if you're using that. The hiberante.cfg.xml looks like this...
<hibernate-configuration>
<session-factory>
<property name="hibernate.cache.provider_class">com.googlecode.hibernate.memcached.MemcachedCacheProvider</property>
<mapping class="com.yadda.yadda.Something"/>
</session-factory>
</hibernate-configuration>
Then, in your mappings you tell Hibernate that you want instances of your persistent objects to be cached, or collections from relation ships to be cached. Once Hibernate knows what you want cached you can watch it pump stuff into memcached, which is good clean geeky fun. Fire up memcahed (on windows or linux) using the -vv command line option to make it run "very verbose". You can see it storing and responding for each operation taken.
You can play with the code straight out of subversion at google code. It will actually work and cache stuff, but it is currently hardcoded to look only at localhost:11211 for a memcached instance. I'll get around to making it configurable. To build the code you'll need Maven2. I highly recommend using Don Brown's no-suck port of maven2 actually.
More to come...
Labels:
Hibernate,
hibernate-memcached,
Java,
Memcached,
Tech
Cache Everything
So I'm working on this Web Service project and its time to consider scalability. Which means its time to setup memcached. If you haven't looked at using memcached, you should.
Memcached is a totally stupid-simple distributed memory object cache. It's this super tiny application that slices off a chunk of RAM and listens on a port. Yeah, that's about it :)
It gets cool to talk about when you start talking about making it "distributed". When you start talking about "Distributed Caches" people start thinking about Coherence and other hugely complicated and hugely expensive enterprise applications. It really dosen't have to be so hard.
Here's what you do. Get a couple cheap boxes with one or two gigs of ram in them. Install the Linux flavor of your choise. Install memcached and run it with "memcached -d -m 1024". This will start memcached on it's default port (11211) and allocate 1gb of ram to the cache. If you do this on three boxes, you now have a 3gb distributed cache.
There are client libraries available for most popular languages. If you're using Java I'd highly recommend using spymemcached from Dustin Sallings.
So you give the clients a list of servers to connect to and they will basically treat that big distributed cache you created as a huge hashtable. Each get/set operation has a string key that is hashed and used to decide what "partition" of the cache to read/write to. If an instance goes down the client just begins distributing reads/writes to the other instances until the missing member comes back.
Using any of the client libraries, in just about any language, your usage looks like this:
Memcached uses a very light and fast binary protocol which makes it usable by just about any language. There are pre-built packages in apt if you're using Ubuntu, you can easily build it from source for just about any other *nux flavor. There's even a windows port. I've only used that for dev at this point though.
I'm working on writing a second level cache for hibernate that uses memcached. It is super simple, but I just started work on it last night (seriously). Check it out if you want. I plan to work on it over the next few nights and get it ready for prime time :)
Memcached is a totally stupid-simple distributed memory object cache. It's this super tiny application that slices off a chunk of RAM and listens on a port. Yeah, that's about it :)
It gets cool to talk about when you start talking about making it "distributed". When you start talking about "Distributed Caches" people start thinking about Coherence and other hugely complicated and hugely expensive enterprise applications. It really dosen't have to be so hard.
Here's what you do. Get a couple cheap boxes with one or two gigs of ram in them. Install the Linux flavor of your choise. Install memcached and run it with "memcached -d -m 1024". This will start memcached on it's default port (11211) and allocate 1gb of ram to the cache. If you do this on three boxes, you now have a 3gb distributed cache.
There are client libraries available for most popular languages. If you're using Java I'd highly recommend using spymemcached from Dustin Sallings.
So you give the clients a list of servers to connect to and they will basically treat that big distributed cache you created as a huge hashtable. Each get/set operation has a string key that is hashed and used to decide what "partition" of the cache to read/write to. If an instance goes down the client just begins distributing reads/writes to the other instances until the missing member comes back.
Using any of the client libraries, in just about any language, your usage looks like this:
- Check the cache for your object.
- If your object is not null, return the object.
- Otherwise, read the object from the database or what have you.
- Put the object in the cache.
- Return the object.
Memcached uses a very light and fast binary protocol which makes it usable by just about any language. There are pre-built packages in apt if you're using Ubuntu, you can easily build it from source for just about any other *nux flavor. There's even a windows port. I've only used that for dev at this point though.
I'm working on writing a second level cache for hibernate that uses memcached. It is super simple, but I just started work on it last night (seriously). Check it out if you want. I plan to work on it over the next few nights and get it ready for prime time :)
Wednesday, March 05, 2008
Open Source Licensing: WTFPL
I think I'm going to start using this license for any open source stuff I do...
WTFPL
WTFPL
Friday, February 29, 2008
Tuesday, February 05, 2008
Grails 1.0 Released
Graeme Rocher, from G2One Inc., announced the release of Grails 1.0 this morning. The release notes are available from grails.org.
If you're a Java person and aren't familiar with Grails or Groovy for that matter, you should definitely check out Grails. Grails is a rapid web application development framework based on convention over configuration. It is designed MUCH like Ruby-on-Rails, but built using Groovy as a language. The main benefits of this approach is that Groovy is based on Java; which means it looks and feels like Java. This helps introduce it to a team and lower the learning curve. The other benefit is that it builds down to a WAR file that you can deploy into any old application server. No special hackery required. This is important when deploying it into a very 'enterprisey' environment.
Also, the internals of Grails and how it works are not based on it's own invented voodoo. Grails uses Spring, Hibernate, and Acegi internally. Good stuff...
If you're a Java person and aren't familiar with Grails or Groovy for that matter, you should definitely check out Grails. Grails is a rapid web application development framework based on convention over configuration. It is designed MUCH like Ruby-on-Rails, but built using Groovy as a language. The main benefits of this approach is that Groovy is based on Java; which means it looks and feels like Java. This helps introduce it to a team and lower the learning curve. The other benefit is that it builds down to a WAR file that you can deploy into any old application server. No special hackery required. This is important when deploying it into a very 'enterprisey' environment.
Also, the internals of Grails and how it works are not based on it's own invented voodoo. Grails uses Spring, Hibernate, and Acegi internally. Good stuff...
Sunday, January 27, 2008
Out of the Sandbox: Spring-Security OpenID Support
I just finished moving the OpenID support For Acegi/Spring-Security out of the sandbox and out into it's own module. It is in dire need of documentation, but the code itself is pretty solid.
Here's the post to the mailing list.
Here's the post to the mailing list.
Sunday, January 20, 2008
Save Windows XP
InfoWorld has started a petition aimed at getting Microsoft to keep Windows XP support around past the June 30th end-of-life date.
To summarize, here's why I like XP...
- XP is simply the best OS Microsoft has produced. I realize that doesn't say much, but it's true.
- I am a gamer. I'd gladly run Ubuntu or Fedora Linux, but I am not down with playing Pac-man, Super-pacman, or one of 200 Tetris clones.
- I'd love to get a Macbook, but they're really expensive, and again, I don't like pacman.
- Vista blows
So, sign the SaveXP Petition at SaveXP.com
Wednesday, January 16, 2008
Sun to Buy MySQL
This is huge news! MySQL has to be the single most popular open-source database in the world.
Tuesday, January 15, 2008
Acegi OpenID Support Update
I said I'd work on the OpenID support in Acegi (aka Spring-Security) and I finally did. Really nothing major, I refactored the functionality from the CAS package that we needed in OpenID up into its own existence in the "providers" package. So now there's a now AuthoritiesPopulator and DaoAuthoritiesPopulator impl that uses the UserDetailsService to look up Authorities for a given principal. This functionality was being "borrowed" from the Cas package, now it's been refactored up. For backwards compatibility I've left the original CasAuthoritesPopulator and DaoCasAuthoritiesPopulator items in as subclasses of the new classes. Both of those extensions are empty now though. They should be removed in the future.
Also, I've removed the janrain support as Janrain is dead. Spring-Security will now use openid4java exclusively. It has been updated to version 0.9.3 of that library.
Now the call goes out to Jeff Dwyer to update MyHippoCampus to the latest stuff and put it through its paces. Thanks Jeff!
Next up? Well, I'm going to slap it into one of the samples and do some testing, and then work on promoting it out of the sandbox. Hopefully we can get openId support into the main project soon :)
Also, I've removed the janrain support as Janrain is dead. Spring-Security will now use openid4java exclusively. It has been updated to version 0.9.3 of that library.
Now the call goes out to Jeff Dwyer to update MyHippoCampus to the latest stuff and put it through its paces. Thanks Jeff!
Next up? Well, I'm going to slap it into one of the samples and do some testing, and then work on promoting it out of the sandbox. Hopefully we can get openId support into the main project soon :)
Wednesday, January 09, 2008
OpenID Gains Steam
From Techcrunch
TechCrunch UK’s Mike Butcher is reporting that Google, IBM and Verisign are in late stage discussions with the OpenID Foundation.
Good to see OpenID getting some traction. I really regret not finishing up the OpenID support for Acegi now. The code is still there in the sandbox. It apparently works, the folks over at MyHippoCampus were using it.
Tuesday, January 08, 2008
An Exercise in Flowcharting
Wednesday, January 02, 2008
Is Rails a Ghetto?
Zed Shaw, creator of the extremely popular Mongrel server for Rails applications, thinks so.
Rails Is A Ghetto
Even if you don't know a damn thing about Ruby or Rails this is some pretty funny shit.
Rails Is A Ghetto
Even if you don't know a damn thing about Ruby or Rails this is some pretty funny shit.
Friday, December 21, 2007
Ruby on Rails Stuff
I've found a few interesting resources for Ruby on Rails stuff and I figure I'll link 'em up here.
First up, Railscasts.com; a collection of video screencasts on various small Rails tricks.
Railscasts.com
Next, a presentation from Dave Thomas at QCon about meta-programming in Ruby.
MetaProgramming - Extending Ruby for Fun and Profit
Rails 2.0 just came out, here's a post from DHH about some of the new features.
Rails 2.0: Preview Release
Also, if you don't own a Mac and therefore don't have that sexy Textmate editor, you might consider NetBeans 6.0. Netbeans used to be a joke of an IDE for Java but it's really come along nicely for Java and has really excelled in it's support for Ruby and Ruby on rails.
NetBeans: Ruby Developer's New Best Friend (Part 1)
NetBeans: Ruby Developer's New Best Friend (Part 2)
First up, Railscasts.com; a collection of video screencasts on various small Rails tricks.
Railscasts.com
Next, a presentation from Dave Thomas at QCon about meta-programming in Ruby.
MetaProgramming - Extending Ruby for Fun and Profit
Rails 2.0 just came out, here's a post from DHH about some of the new features.
Rails 2.0: Preview Release
Also, if you don't own a Mac and therefore don't have that sexy Textmate editor, you might consider NetBeans 6.0. Netbeans used to be a joke of an IDE for Java but it's really come along nicely for Java and has really excelled in it's support for Ruby and Ruby on rails.
NetBeans: Ruby Developer's New Best Friend (Part 1)
NetBeans: Ruby Developer's New Best Friend (Part 2)
Saturday, December 15, 2007
A Brief Introduction to REST
InfoQ posted a very good article introducting the concepts of REST. If you've heard the buzz and are looking for a practical explanation, this looks like a good place to start.
A Brief Introduction to REST
A Brief Introduction to REST
Tuesday, November 20, 2007
Spring Framework 2.5 Released
http://www.springframework.org/node/561
The latest version of Spring is released, and it has tons of new features. I can't wait to get them going in some of my projects. I'm especially excited about using the @Resource annotation support.
The good folks at InfoQ have posted the first of a series of articles about Spring 2.5. Have a look...
http://www.infoq.com/articles/spring-2.5-part-1
The latest version of Spring is released, and it has tons of new features. I can't wait to get them going in some of my projects. I'm especially excited about using the @Resource annotation support.
The good folks at InfoQ have posted the first of a series of articles about Spring 2.5. Have a look...
http://www.infoq.com/articles/spring-2.5-part-1
Thursday, November 15, 2007
NBC Pulls their Youtube Channel
I just noticed today that NBC pulled down their YouTube channel. This is a tragedy. I loved watching the stuff they put up. I was generally impressed with NBC and the amount of content they were putting out on YouTube. Hell, I am still impressed that you could watch past episodes of their shows on their site.
Unfortunately, I shouldn't have to be impressed by this. How hard is that? You lace some commercials in for revenue and you put the stuff online to watch. How different is that from TV right now?
Good bye http://www.youtube.com/NBC, thanks for breaking all the links on my SNL Digital Shorts post...
Unfortunately, I shouldn't have to be impressed by this. How hard is that? You lace some commercials in for revenue and you put the stuff online to watch. How different is that from TV right now?
Good bye http://www.youtube.com/NBC, thanks for breaking all the links on my SNL Digital Shorts post...
Tuesday, October 30, 2007
Introduction to the Spring Framework 2.5
Rod Johnson updated his "Introduction to the Spring Framework" article to include the Spring 2.5 updates.
I've always forwarded this article on to folks that are new to Spring to get a footing.
Link
I've always forwarded this article on to folks that are new to Spring to get a footing.
Link
Subscribe to:
Posts (Atom)