Posts tagged with “development”
Sharing user credentials between MySQL Servers with MySQL Cluster
Andrew Morgan has a great post up about a new feature in MySQL Cluster 7.2 that alleviates a pain point I've encountered in the past. Andrew explains,
The Developer Release for MySQL Cluster 7.2 includes a new feature that allows the system data required for checking user access to be shared amongst all of your MySQL Servers. By default all of the tables holding these credentials are stored in MyISAM and so are local to that MySQL Server.This can become painful to manage – every time you want to create a new user or change their permissions you need to repeat it on every server, miss one out and the user won’t be able to access that server (or will still be able to access it after you withdraw their privileges).
Head over and check it out, and subscribe to my MySQL Cluster bundle on Google Reader!
MySQL Cluster: Generating Partition Reports
If you're using MySQL Cluster and have recently added a nodegroup, you can use the following code to generate a report of what tables are currently partitioned across the nodes as you apply ALTER ONLINE TABLE ... REORGANIZE PARTITION to them to get them partitioned:
select count(p.table_name) as partitions, p.table_schema, p.table_name from tables t join partitions p on (t.table_schema=p.table_schema and t.table_name=p.table_name) where t.engine='ndbcluster' group by p.table_schema, p.table_name order by partitions desc;
You'll get a nice clean report of all your tables, what schema they belong to, and how many partitions they have. Use in combination with my method of finding the largest tables in MySQL and you'll ensure smooth growth of your cluster!
Find Largest Tables in MySQL
If you're trying to find what tables in your MySQL deployment are consuming the most amount of space, you can use the following query to find this information directly from the information schema.
SELECT CONCAT(table_schema, '.', table_name), CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows, CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA, CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx, CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size, ROUND(index_length / data_length, 2) idxfrac, engine FROM information_schema.TABLES ORDER BY data_length + index_length DESC LIMIT 25;
You'll get a list of the top 25 tables by total size (index size + data size), how many rows they have, and the engine they are using to be stored. Being able to see what engine is being used is especially helpful when running MySQL Cluster.
RSS is back, or "a brief history of EricMartindale.com"
Hello there, adoring internet-stalkers! (I'm kidding. ~_~) You may have noticed (if you were loyal, that is ;)) that my Feedburner-powered RSS Feed has been lacking in activity lately. There's a reason for that.
Recently, I got rid of WordPress and Sweetcron in favor of a new CMS platform, Chyrp. I had been running Wordpress for a long time, using it to share my thoughts with the general internet populace. However, it had become a bit of a chore to maintain, and it really felt like duplicate work on top of all the other content-generation I was already performing (i.e., forum posts, blog comments, Last.fm "Loved" Tracks, Google Reader shared items, etc.), so I began to look for a way to aggregate this content into a central place.
For a while, FriendFeed served this purpose well, but I didn't like the lack of control I had over the source. Facebook also filled part of this gap (and it still does, to a point), and they've even purchased FriendFeed, but I was looking for something quite a bit more customizable and self-hosted. Through various referrals, I came across Yongfook's Sweetcron project which was a new platform designed specifically for this new thing they called, *le gasp*, "Lifestreaming".
However, after fighting with Sweetcron and its aggregation methods, particularly its lack of support for various service feed formats; I decided to look into something else. Initial searches landed me upon Tumblr, who had conveniently announced a feature that syncs comments across multiple services (or aggregates). Sadly, I didn't want to get back into a world where all my code was hosted by someone else, and I had no control over it. I kept Sweetcron running on my site under lifestream/, but I continued searching for a better solution.
I then stumbled across Bazooka, which was billed as "the first free PHP tumblelog engine". Thanks to Bazooka developer Evan Walsh, who alerted me to a more up-to-date and current replacement called Chyrp. And I was sold. I immediately spent a few hours converting my existing content from WordPress and SweetCron over to a test installation of Chyrp, and then took the next night changing my site structure and 301'd all my old links to the new URLs.
That's where EricMartindale.com stands today. I've spent a few weeks getting my stream set up the way I want it, and I'm turning the RSS feed back on. Posts should begin flowing into your RSS reader very shortly. Post comments, feedback, and questions here!
Edit 10:13 PM EST: It looks like Feedburner is having some trouble parsing my new RSS content. You can subscribe to my direct feed and it will always work.
Edit 10:58 PM EST: I've fixed the problem and committed the patch to GitHub.
Coding Contest: Shortest Full-featured CMS, BB, or Blog
There's a large number of Content Management System, Bulletin Board, and Blog solutions available, all with amazing functionality that simply can't be missed on today's rapidly advancing internet(s).
Examples
CMS: Joomla, with around 280,000 lines of code.
BB: phpBB, with around 150,000 lines of code.
Blogs: WordPress, with around 170,000 lines of code.
My challenge is this:
What is the smallest full-featured CMS, BB, or Blog that you can create?
Contest submissions must include the following features:
- User Accounts
- Article Posts (or "Topics" in BB-land)
- Comment System
Submissions will be accepted in any language, so long as the content can be served up over HTTP. To submit, comment on this post with a link to your project!
Good luck and happy coding!