» Archive for November, 2007

lbpool - Load Balancing JDBC Pool

Thursday, November 22nd, 2007 by rubypdf

The lbpool project provides a load balancing JDBC driver for use with DB connection pools. It wraps a normal JDBC driver providing reconnect semantics in the event of additional hardware availability, partial system failure, or uneven load distribution. It also evenly distributes all new connections among slave DB servers in a given pool. Each time connect() is called it will attempt to use the best server with the least system load.

The biggest scalability issue with large applications that are mostly READ bound is the number of transactions per second that the disks in your cluster can handle. You can generally solve this in two ways.

1. Buy bigger and faster disks with expensive RAID controllers.
2. Buy CHEAP hardware on CHEAP disks but lots of machines.

We prefer the cheap hardware approach and lbpool allows you to do this.

Even if you *did* manage to use cheap hardware most load balancing hardware is expensive, requires a redundant balancer (if it were to fail), and seldom has native support for MySQL.

The lbpool driver addresses all these needs.

The original solution was designed for use within MySQL replication clusters. This generally involves a master server handling all writes with a series of slaves which handle all reads. In this situation we could have hundreds of slaves and lbpool would load balance queries among the boxes. If you need more read performance just buy more boxes.

If any of them fail it won’t hurt your application because lbpool will simply block for a few seconds and move your queries over to a new production server.

While currently designed for MySQL this could easily be updated to support PostgresQL or any other DB that supports replication.

btw, the download link from http://code.tailrank.com/lbpool/ is not correct, the correct one is http://download.tailrank.com/lbpool-1.1.0.tar.gz

the source code of cjkdemo.aspx on my free asp.net hosting

Wednesday, November 21st, 2007 by rubypdf

Recently, there are many people asked the source code of cjkdemo.aspx on my free asp.net hosting, so I decide release it here, there is no special.
to run it, you need iTextSharp, iTextAsian-1.0.dll and iTextAsianCmaps-1.0.dll, you can download them from http://itextsharp.sourceforge.net/.

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
 
using iTextSharp.text;
using iTextSharp.text.pdf;
 
public partial class CJKDemo : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
    protected void btnCancel_Click(object sender, EventArgs e)
    {
        txtMessage.Text = string.Empty;
    }
    protected void btnConvert_Click(object sender, EventArgs e)
    {
        try
        {
            Document document = new Document();
            //Document.Compress = false;
            try
            {
                Response.Cache.SetCacheability(HttpCacheability.Public);
                Response.Cache.SetExpires(DateTime.Now.AddSeconds(5));
                Response.ContentType = "application/pdf";
                Response.AddHeader("content-disposition", "attachment; filename=CJKDemo.pdf");
                //BaseFont.AddToResourceSearch(MapPath(@".\itextsharpasian\") + "iTextAsian-1.0.dll");
                //BaseFont.AddToResourceSearch(MapPath(@".\itextsharpasian\") + "iTextAsianCmaps-1.0.dll");
                PdfWriter.GetInstance(document, Response.OutputStream);
 
                //PdfWriter.GetInstance(document, new FileStream(@"E:\java\Japanese.pdf", FileMode.Create));
                document.Open();
 
                BaseFont bf = BaseFont.CreateFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
 
                Font font1 = new Font(bf, 12, Font.NORMAL);
                Paragraph par = null;
                ChapterAutoNumber charp = null;
				 par = new Paragraph("iTextSharp支持中文输出", font1);
				 charp = new ChapterAutoNumber(par);
                for (int i = 0; i < 20; i++)
                {   
                    document.Add(charp);
		            document.Add(new Paragraph(txtMessage.Text, font1));	                		                		                
                }
 
 
            }
            catch (Exception ex)
            {
                Response.Clear();
                Response.ContentType = "text/plain";
                Response.Write(ex.Message);
                return;
            }
            document.Close();
        }
        catch (Exception)
        {
            throw;
        }
        Response.End();
    }
}

MetaASO eForms framework goes Freeware

Wednesday, November 21st, 2007 by rubypdf

eForms is a technology based on XML documents that replaces the use of paper based work in an organisation.

Any paper based process in an organisation is routed between people and can be automated using workflow systems without the need for eforms. But eForms are XML documents that can be edited by hand but would lead to invalidating the signatures. So if you need integrity, non-repudiability and non-forgeability, self contained eForms provide the answer.

The most popular products in the market are Microsoft with Infopath, IBM with Pureedge and Adobe with Livecycle server. Each with its own strengths and weaknesses.

The eForms framework can be downloaded from http://metaaso.com

Feel free to use the contact us links on the website to tell us what you think and how you would like us to help building the next generation of eForms based solutions. We would be releasing a .NET version of the software in the near future. Do give it a try and tell us what you think. There are no ads, no payments, and the license just says as long as we are not held liable you are free to do whatever you want with it.