Programming Trade-offs
Sep. 7th, 2005 12:25 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
So, the new news system at RPGnet is definitely going. As I mentioned you can access it at
rpgnet_news.
But there was a bit of a trade-off in my design that I still haven't decided on.
The news system is now database driven, but one of my rules for the RPGnet homepage remains, "No database access", so that even if MySQL locks up (and it does) the front page is always visible. Thus whenever I put new info on the front page I have to do it via an intermediary flat file.
For the reviews I constructed my own flatfile format and it sometimes breaks with unexpected user input.
For the news I instead had a great idea. I knew I was going to make it available via RSS, so why not just read the front page news straight off the RSS feed, which is a flat file stored on the server?
So, the RPGnet home page now reports its news via its own RSS feed (in fact, using the same functions that I use to read other sites' RSS feeds in the updated Press & News section).
This is very elegant and very easy to update.
There's a downside though: caching. RSS feeds always get cached by the functions I use, so that you only hit a remote site once an hour rather than every time someone reads the RSS. This now means that the update of the RPGnet home page lags an average of 30 minutes past the update of the news.
Hmmm.
I haven't decided if this is a real enough problem to change things or not.
![[livejournal.com profile]](https://www.dreamwidth.org/img/external/lj-syndicated.gif)
But there was a bit of a trade-off in my design that I still haven't decided on.
The news system is now database driven, but one of my rules for the RPGnet homepage remains, "No database access", so that even if MySQL locks up (and it does) the front page is always visible. Thus whenever I put new info on the front page I have to do it via an intermediary flat file.
For the reviews I constructed my own flatfile format and it sometimes breaks with unexpected user input.
For the news I instead had a great idea. I knew I was going to make it available via RSS, so why not just read the front page news straight off the RSS feed, which is a flat file stored on the server?
So, the RPGnet home page now reports its news via its own RSS feed (in fact, using the same functions that I use to read other sites' RSS feeds in the updated Press & News section).
This is very elegant and very easy to update.
There's a downside though: caching. RSS feeds always get cached by the functions I use, so that you only hit a remote site once an hour rather than every time someone reads the RSS. This now means that the update of the RPGnet home page lags an average of 30 minutes past the update of the news.
Hmmm.
I haven't decided if this is a real enough problem to change things or not.