(Free) Distributed System Proof-of-Concept

I recently completed and implementing the system design of an application. The system design is web based, but the direction shifted to win32 desktop-based application in the second half of the design phase. This isn't ideal, but it's still fine, as system design phase mainly focuses on functional module design, database design and capturing business requirements from a more technical view.

Lots of facts happened while I running the system, but only several major things that I could tell you right now. It seems to be an early warning for you if you have the same project type as me, such as :

1. Database synchronization
This internal application has local database containing tens of tables that should synchronized to the web system when it ready. Now you need to learn, when and how the database will transported down or up - or even control what's down to user database. Beware that weak system design will make synchronization potentially ruined.

2. User Sign On
User control is more important to the system wide globally that affect both desktop and web after all. Notice when and how is user accepted or rejected from the system.

3. Application Distribution
At this moment, the biggest benefit everyone agrees, is that web-application does not require client side deployment. But how you control desktop based application deployment and versioning problem more effective?

However, we're focussed at last point, the software distribution it self. Since this particular system is unique, but I think I made this one succesfully. Starting from theory lesson, ends up with the conceptual practice, finally I named it as SISPIu Distribution Management. And here's the story...

Theory
Software distribution is the process of delivering software to the end user. It may take the form of a binary distribution, with an executable or installer which can be downloaded from the network or wide area Internet.



At least, there are four features of software distribution system. One of it, is, remote installation, which it will perform automatic installation and execution of software as well as wizard utility to make a distribution package. Other than that is monitoring status of distribution, it provided with compression technique to minimize size of files being distribute and it will be function to remotely some operations (reboot PC and remote execution if it necessary). Additional Features that included is real time monitoring of software distribution process. Enable or disable limit administrative function to Normal User and standardize Desktop
Environment are the roles of policy control.

Basic Principal of SISPIu Distribution Management
For the sake of completeness, I’ve included basic principal Guidelines below. It's slightly designed to suit the needs, there are:
  1. Local installation contains package and updater module. While the updater module functioned as package transporter, the package it self should meet versioning number rule below.
  2. A normal version number MUST take the form X.Y.Z where X, Y, and Z are non-negative integers. X is the year age of software (starting with 1), Y is the month age of software after X, and Z is the day of software released. Each element can bound numerically and depends on when the package deployed. For instance: 1.0.0 (initial deployment) -> 1.9.5 -> 1.10.9 -> 1.11.24. Patch version is not considerably needed, but you able to add it. Hence, there's no 0 number here (except for initial version). Nor major or minor version. This is what I called as simplify the version number, as we'll know directly how long that two version released or how old the application stand?
  3. Once a versioned package has been released, the contents of that version MUST NOT be modified. Any modifications must be released as a new version. All packages (old and new version) must stored in the same server directory and accessible through defined IP number and port, which that both number (also username and password if required) are embedded to the package.
  4. The package should contains versioning checker and validation module, also server URL and access account. Once a versioned package detected as a newest than existing package version, call the updater module and shut the current running package.
  5. After download successfully the new package, updater module should execute new package and shut down it self.
That's all, but anyway, sorry, I can't share code for this concept :)

Conclusion
I rely on various web applications to do tasks, projects and life. But I still believe the future of computing isn't entirely web-based. It's necessary to have the desktop as the pivotal point, because the power of the desktop is important for a rich user experience - and will be, for a very long time to come.

That is why software distribution become my critical point since what we require then are smart, webified, internet deployable desktop applications - that can reliably store data, serve it robustly, and interact with both remote and local databases. Also uninterrupted experience during version updates.

What is your thought? Do you have a successful story or failure to share?

Labels: ,

  Post a Comment

POS System Review: The Simplest, The Lightest and The Cheapest

Anyone can find cheapest Point of Sale (POS) hardware environment recently in this world (including barcode printer, barcode scanner, CPU & display monitor)? Well, I can find it for US$ 493 with all brand new devices! No kidding but here's the truth. All things has passed for future consideration, including lower electricity cost, easier to use barcoding on your store around and simple custom-made software for checkout purposed.

This is without receipts printer since this POS focused on stocking intention. So, receipt coupon for customer is infrequently or even never used, hereby changed with manual hand written.

And, here's the secret:


Zotac ZBOX ID41
WTH is this? Weird branded CPU name born in (nearly) Hong Kong with core business on mini-ITX and mini-PC since… 2006. That's why I choose it apart from it best mixed hardware combination.


This mini PC is thinner but wider than Mac Mini G4.


See link below for detail information:

http://www.zotac.com/index.php?page=shop.product_details&flypage=flypage_images-SRW.tpl&product_id=335&category_id=171&option=com_virtuemart&Itemid=100295&lang=un

Interesting?

Epson LabelWorks LW-400
This is an evolution for Epson to providing a low cost label printer. See the spoiler below:

http://www.epson.com/cgi-bin/Store/jsp/Product.do?sku=C51CB70010

The LW-400 is the minimum series to support barcode printing prior to LW-900.


The packing size slightly larger than Mac Mini G4.


A full qwerty printer at notebook size but more a little thicker. Very handy and ergonomic when hands on and feels light weight too. Just like seeing a BlackBerry with monster size :D


There're also 12mm black-on-white LC sample tape cassette including in the box, with easy way to setting-up on the printer. First press lid button to open the back cap and pull it.


Place the tape in proper way (green box) with outer ribbon attached on small slot (red circle).


Next, close the back cap slowly until it show as normal.


This series operated with dual mode; 6AA battery and power cable. You'll find a power cable included in the box. Make a power connection and press power button.


To switch to barcode printing, press ALT+barcode key as shown as picture above. Then pick one from several built-in barcode font available and specify the size. Sorry, can't tell you what else barcode font built-in included since I'm not an Epson salesman :)


Type-in some digits of numerical code to test. If you like to print copies, press copier button (red circle) several times until it displayed how much copy you want to print out. Ended with print button (green box) to start to print.


This LW-400 series also equipped with manual cutter. So, after print stopped, just press green button in right side to cut-off the paper. Simple and easy.

CipherLab 1070
Finally found a low cost scanner with fairly well-known brand name: CipherLab.


See below spoiler:

http://www.cipherlab.com/catalog.asp?CatID=8&SubcatID=10&ProdID=354

Not too worry, it can read Epson barcode print out result (by using EAN-13 small 5cm size :)


Conclusion
Building recently POS (hardware & software) system much easier than couple years ago. From above specification, there's no need to create an add-in module to print the barcode from application.


It's separate anyway. So it takes shorter time to developing the software. What you need is to mix and match everything. That's it! Thank's for reading and see you on next article...

Labels: , , , , , , , , ,

  Post a Comment

Auto-Synchronize Over FTP Link (RedHat & Ubuntu)

In a spesific programming case, database synchronization method will needed to accomodate data transfer between 2 or more servers. There are so much techniques we can adopt to make it work. And that's all depends on needs, business requirement, infrastructure availability & of course skill of you're own self.

Anyway, I don't wanna talk about synchronization techniques but actually, this latest article was begun from my previous one - Simple MySQL Replication Using FTP - when I implement automatically SQL file synchronization - using FTP protocol & by the help of crond daemon - between 2 RedHat (RHEL) server. The goal is that both servers having the same databases & tables (server A sending data to server B, server B sending data to server A).

However, the problem arises when one of the server changed the OS from RHEL to debian based (Ubuntu). While the automatic script I made from RHEL won't work on Ubuntu - especially the lines referring to FTP commands - bash shell script.

So, how to make the synchronization running again? No doubt, rewrite the script ASAP! Take a look at below script:

echo machine your.domain.or.ip > /root/.netrc
echo login your_username >> /root/.netrc
echo password your_password >> /root/.netrc
chmod 600 /root/.netrc

ftp your.domain.or.ip <<_FTP_
binary
put name.of.the.file
bye
_FTP_


Above is the code that only work on RHEL. While the FTP account created on separated file named by .netrc, this is not compatible to Ubuntu.

ftp -n -i <<_FTP_
open your.domain.or.ip
user your_username your_password
binary
put name.of.the.file
quit
_FTP_


Somehow, the FTP account initialization right on above script is integrated in the same script. And it just succedded running in Ubunru server. Moreover, there's no script affected in other servers. So, lesson of learning today is: never change server OS except you're ready for the impact. Deal?

Labels: , , , , , , ,

  Post a Comment

JavaScript: Return Multiple Values in Count Between Dates Function

JavaScript is one of parts that can’t be separated with web programming. Sometimes we usually depend on it, although we can solve the problem with another technique but the use of JavaScript is much helpful to support dynamic runtime application. For example manipulating or counting math is possibly without refreshing the page. Therefore, it is much simpler than AJAX. This article purposely dedicated to my self & any newbies which want to learn JavaScript methods.

Just like my own experience improving a page counting difference between two dates, here I found something new & I’d like to archived for me then share to you. The web page project it self are related to MySQL date field type & based on PHP programming. The subject was, how to calculate the year & month difference by both dates after the page loaded & once the date object is changed? As usual, I set the date interface with JavaScript so it would generate an interesting GUI just like common date object on Win32 programming.



Those dates GUI are compatible with date type format in MySQL (yyyy-mm-dd). When the date icon clicked, it will show small interactive calendar panel. The first date object I named with date_start, the second is date_end & sequentially, the difference year & month is n_year & n_month. The core date subtract function need 2 parameter dates & I created as well as it will return more than one value (year & month). On JavaScript, the treatment is put it on array mode. Pick out a small portion below:

function selisihTgl(dateEnd,dateStart)
{

return [yearAge, monthAge];
}


Displaying returned both value from function in array are simply called the array variable just like any others programming which is 0 based in bracket.

function fSelisih(sender)
{

obj.n_year.value=selisih[0]
obj.n_month.value=selisih[1]
}


That’s it, kinda simple isn’t it? By the way – unfortunately -, when dates changed, the date GUI object doesn’t have trigger event to call the function. So, I take <FORM> tag with onMouseMove event. Pretty dumb, but it works fine. Below is complete script from A to Z, check this out:

// portion of PHP code to retrieve both dates value from MySQL database
...
//
<HTML>
<HEAD>
<TITLE>Your Title Please</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</HEAD>
<script language="JavaScript">
function selisihTgl(dateEnd,dateStart)
{
var baru = new Date(dateEnd.substring(0,4),
dateEnd.substring(5,7)-1,
dateEnd.substring(8,10));

var yearBaru = baru.getYear();
var monthBaru = baru.getMonth();
var dateBaru = baru.getDate();

var lama = new Date(dateStart.substring(0,4),
dateStart.substring(5,7)-1,
dateStart.substring(8,10));

var yearLama = lama.getYear();
var monthLama = lama.getMonth();
var dateLama = lama.getDate();

yearAge = yearBaru - yearLama;

if (monthBaru >= monthLama)
var monthAge = monthBaru - monthLama;
else
{
yearAge--;
var monthAge = 12 + monthBaru -monthLama;
}

if (dateBaru >= dateLama)
var dateAge = dateBaru - dateLama;
else
{
monthAge--;
var dateAge = 31 + dateBaru - dateLama;

if (monthAge < 0)
{
monthAge = 11;
yearAge--;
}
}

return [yearAge, monthAge];
}


function fSelisih(sender)
{
var obj=sender;
var selisih = selisihTgl(obj.date_end.value,obj.date_start.value);
obj.n_year.value=selisih[0]
obj.n_month.value=selisih[1]
}
</script>
<BODY onLoad="fSelisih(this)">
...
<form action="path/to/save/or/ignore/it" method="post" name="form1" onMouseMove="fSelisih(this)">
...
</form>
...
</BODY>
</HTML>


Don’t forget to insert the function within onLoad event on <BODY> tag to automatically count them expressly when the page are fully loaded.



Done! Enough for now lesson & I’ll be back with another unique tips & trick programming.

Labels: , , , , , , , ,

  Post a Comment

Last Minutes on Pekanbaru

Once again, I was on my journey to Pekanbaru by my own self due to my existing ongoing project on last Saturday. There were several points have to be done on it. I have to completed some missing documents after got flooded last month, installing the main server & also checking the network status. The next target date will be on 2nd week of this month, so I have to working on it as fast as I can.

By the way, the server are come with Dell brand name, inside the box are stay 3 GHz Intel processor, 1 GB of RAM & 160 GB hard drive. I've installing it with Linux Fedora Core 5 & finished for less than 30 min. The server are done configured with Apache web server & MySQL 5 to accommodate the needs.

To backing up the data, i also set the automatic data recovery which run at 01.00 pm every single day & optionally to powering off at 05.00 pm with cron daemon assist. Hope that the hardware are qualified to fulfill the operational for several years.

Labels:

  Post a Comment