Friday 29 April 2022

Distributed Systems

 Distributed Systems

  • Consists of multiple computers and software components that communicate through a computer network. 
  • Can consist of any number of possible configurations, such as mainframes, workstations, personal computers, and so on. 
  • The computers interact with each other and share the resources of the system to achieve a common goal
Advantages of Distributed Systems 
  1. Reliability (fault tolerance) 
    • The important advantage of distributed computing system is reliability. If some of the machines within the system crash, the rest of the computers remain unaffected and work does not stop. 
  2. Scalability 
    • In distributed computing the system can easily be expanded by adding more machines as needed. 
  3. Sharing of Resources 
    • Shared data is essential to many applications such as banking, reservation system. As data or resources are shared in distributed system, other resources can be also shared (e.g. expensive printers).
  4. Flexibility 
    • As the system is very flexible, it is very easy to install, implement and debug new services. 
  5. Speed 
    • A distributed computing system can have more computing power and it's speed makes it different than other systems. 
  6. Open system 
    • As it is open system, every service is equally accessible to every client i.e. local or remote. 
  7. Performance 
    • The collection of processors in the system can provide higher performance (and better price/performance ratio) than a centralized computer. 
Disadvantages of Distributed Systems 
  1. Troubleshooting 
    • Troubleshooting and diagnosing problems. 
  2. Software 
    • Less software support is the main disadvantage of distributed computing system. 
  3. Networking 
    • The network infrastructure can create several problems such as transmission problem, overloading, loss of messages.
  4. Security 
    • Easy access in distributed computing system increases the risk of security and sharing of data generates the problem of data security

Wednesday 27 April 2022

Platform as a service (PaaS)

Platform as a service (PaaS) 

  • The PaaS model provides the tools within an environment needed to create applications that can run in a Software as a Service model 
  • PaaS is application middleware offered as a service to developers, integrators, and architects. 
  • Development and Operation teams use PaaS to design, build, and deliver customized applications or information services. 
  • Instead of relying on standardized SaaS, teams using PaaS have more control over solution architecture, quality of service, user experience, data models, identity, integration, and business logic.
  • In PaaS you are given a toolkit to work with, a virtual machine to run your software on, and it is up to you to design the software and its user-facing interface in a way that is appropriate to your needs.
  • So PaaS systems range from full-blown developer platforms like Windows Azure to systems like Drupal, Squarespace, Wolf, and others where the tools are modules that are very well developed and require almost no coding.
  • PaaS solution will ensure the availability of the application despite downtime of the underlying virtual machine by automatically creating a new instance of the application on a new virtual machine when the machine goes down.
  • PaaS systems can be used to host a variety of cloud services
    • Online portal-based applications like Facebook that need to scale to thousands of users 
    • Startup who wants to host their new application in a Software-as-a-Service model 
    • Can also be used for massively parallel computations 
    • Enterprises can deploy their Line-of-Business applications in the cloud, taking advantage of the scale and availability while still maintaining security and privacy of data
PaaS examples 

Windows Azure 
Google App Engine 
Hadoop platform 
Drupal 
Wolf Frameworks 
Force.com 

Amazon Web Services (AWS)

AWS is Amazon’s umbrella description of all of their web-based technology services.  Main services include:

  • Compute 
  • Storage
  • Database
  • Deployment & Management 
  • Application Services 
  • Networking 
  • Content Delivery

Category

Service

Compute

  • Amazon Elastic Compute Cloud (Amazon EC2)
  • Amazon Elastic MapReduce (Amazon EMR)
  • Auto scaling
  • Elastic Load Balancing

Storage

  • Amazon Simple Storage Service (Amazon S3) Amazon Glacier
  • AWS Storage Gateway
  • AWS Import/Export

Content Delivery

  • Amazon CloudFront

Database

  • Amazon Relational Database Service (Amazon RDS)
  • Amazon DynamoDB
  • Amazon ElastiCache

Deployment & Management

  • AWS Identity and Access Management (IAM) Amazon CloudWatch
  • AWS Elastic Beanstalk
  • AWS CloudFormation

Application Services

  • Amazon Simple Queue Service (SQS)
  • Amazon Simple Notification Service (Amazon SNS)
  • Amazon Simple Email Service (Amazon SES)
  • Amazon CloudSearch

Networking

  • Amazon Virtual Private Cloud (Amazon VPC)
  • Amazon Route 53
  • AWS Direct Connect

Tuesday 26 April 2022

SaaS (Software as a Service)

 SaaS - Definition

  • The most complete cloud computing service model is one in which the computing hardware and software, as well as the solution itself, are provided by a vendor as a complete service offering.
  • SaaS is a model where an application is hosted on a remote data center and provided as a service to customers across the internet.
  • In this model the provider takes care of all software development, maintenance and upgrades.
  • Salesforce.com is a common and popular example of a CRM SaaS application.  
Is it customizable?
  • Many people believe that SaaS software is not customizable, and in many SaaS applications this is indeed the case. eg: user-centric application like office suite 
  • Many other SaaS solutions expose Application Programming Interfaces (API) to developers to allow them to create custom composite applications eg: Salesforce.com, Quicken.com, etc 
So, SaaS does not necessarily mean that the software is static or monolithic.

SaaS characteristics
  • The software is available over the Internet globally through a browser on demand 
  • The typical license is subscription-based or usage-based and is billed on a recurring basis 
  • The software and the service are monitored and maintained by the vendor, regardless of where all the different software components are running 
  • Reduced distribution, maintenance costs and minimal end
  • user system costs generally make SaaS applications cheaper to use than their shrink-wrapped versions 
  • Such applications feature automated upgrades, updates, and patch management and much faster rollout of changes 
  • SaaS applications often have a much lower barrier to entry than their locally installed competitors, a known recurring cost, and they scale on demand 
  • All users have the same version of the software, so each user's software is compatible with another's 
  • SaaS supports multiple users and provides a shared data model through a single-instance, multi-tenancy model
SaaS - Pros
  • No large upfront costs - usually free trials 
  • Anywhere, anytime, anyone - mobility 
  • Stay focused on business processes 
  • Change software to an Operating Expense instead of a Capital Purchase, making better accounting and budgeting sense. 
  • Create a consistent application environment for all users 
  • No concerns for cross platform support 
  • Easy Access 
  • Reduced piracy of your software
  • Lower Cost: 
    • For an affordable monthly subscription; 
    • Implementation fees are significantly lower 
  • Continuous Technology Enhancements
SaaS - Cons 
  • Initial time needed for licensing and agreements 
    • Trust, or the lack thereof, is the number one factor blocking the adoption of software as a service (SaaS). 
    • Centralized control
    • Possible erosion of customer privacy 
  • Absence of disconnected use 
  • Not suited to high volume data entry
  • Broadband risk
SaaS ?? 

Imagine a system 
  • where you don't have to buy new hardware or update software 
  • where you pay nothing or pay as much as you use 
  • where everything is done as a service: Infrastructure, computing, storage and usage 
  • where you don't worry about your resources spent on Infrastructure security and operational security  where you cut your IT spending 
  • where you have freedom of usage from anywhere with internet connectivity 
  • which is eco-friendly 
Example SaaS applications 
  1. Salesforce.com 
  2. Google Apps 
    • Gmail, Google Groups, Google Calendar, Talk, Docs, etc 
    • Google Apps Marketplace (Google apps for both free and for a fee) 
  3. Microsoft Office 365 
    • Office 365 is a subscription-based online office and software plus services suite which offers access to various services and software built around the Microsoft Office platform
Which applications are suitable?

Any application can be deployed in this way. However communications over the Internet are not as fast as local connections - so leave any high volume data entry applications on your internal LAN or WAN. All the rest can go on the Internet under a SaaS approach.

Myths 
  • SaaS is still relatively new and untested 
  • SaaS is just another version of the failed ASP and hosting models of the past and will suffer the same fate as its predecessors 
  • SaaS only relieves companies of the upfront costs of traditional software licenses 
  • SaaS is only for small and mid-sized businesses and will not be accepted by large-scale organizations
  • SaaS only applies to applications such as CRM and Salesforce automation 
  • SaaS will only have a minor impact on the software industry and will fade over time 
  • It will be easy for the established software vendors to offer SaaS and dominate this market 
  • SaaS is only for corporate users
Traditional packaged Software Vs SaaS

Traditional packaged Software

Saas

Designed for customers to install, manage and maintain

Designed from the outset up for delivery as Internet-based services

Architect solutions to be run by an individual company in a dedicated instantiation of the software

Designed to run thousands of different customers on a single code

Infrequent, major upgrades every 18-24 months, sold individually to each installed base customer

Frequent, "digestible" upgrades every 3-6 months to minimize customer disruption and enhance satisfaction

Version control

Version control

Upgrade fee

- do -

Fixing a problem for individual customer

Fixing a problem for one customer fixes it for everyone

Monday 25 April 2022

Export mysqli resultset as excel with nested table in PhP

 <?php
error_reporting(E_ERROR | E_WARNING | E_PARSE);
$con = mysqli_connect("localhost", "root", "", "tablename");
if (mysqli_connect_errno()) {
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$output = '';
$stmt3 = $con->prepare("SELECT id,registrationid,name,email,mobile,nationality,state,district,gender from adv33");
$stmt3->execute();
$stmt3->bind_result($id, $registrationid, $name, $email, $mobile, $nationality, $state, $district, $gender);
$stmt3->store_result();
if ($stmt3->num_rows > 0) {
    $output .= '
    <table border="1">
                    <tr>
                        <th>Name</th>
                        <th>Email</th>
                        <th>Mobile</th>                      
                        <th>Nationality</th>
                        <th>State</th>
                        <th>District</th>
                        <th>Gender</th>                                            
                    </tr>
  ';
    while ($stmt3->fetch()) {
        $output .= '
                    <tr>                         
                         <td>' . $name . '</td>
                         <td>' . $email . '</td>
                         <td>' . $mobile . '</td>                         
                         <td>' . $nationality . '</td>
                         <td>' . $state . '</td>
                         <td>' . $district . '</td>
                         <td>' . $gender . '</td>                         
                    </tr>';
        $output .= '                  
         <table border="1">
         <tr>
         <td><b>Post</b></td>
         <td><b>Company</b></td>         
           <td><b>From Date</b></td>
            <td><b>To Date</b></td>
            <td><b>Scale of Pay</b></td>          
   ';
        $stmt4 = $con->prepare("SELECT slno,email,post,company,fromdate,todate,scale FROM adv33exp  where email ='$registrationid'");
        $stmt4->execute();
        /* bind result variables */
        $stmt4->bind_result($slno, $email, $post, $company, $fromdate, $todate, $scale);
        $stmt4->store_result();
        if ($stmt4->num_rows > 0) {
            /* fetch value */
            while ($stmt4->fetch()) {
                $output .= '
                     <tr>
                         <td>' . $post . '</td>
                         <td>' . $company . '</td>                        
                         <td>' . $fromdate . '</td>
                         <td>' . $todate . '</td>
                         <td>' . $scale . '</td>                         
                    </tr>
                ';
            }
        }
    }
    $output .= '</table>';
    header("Content-type: application/octet-stream");
    header("Content-Disposition: attachment; filename=Applicants.xls");
    header("Pragma: no-cache");
    header("Expires: 0");
    echo $output;
}
?>

Sunday 24 April 2022

How to get hidden field value in jquery?

JS Code 

<script>

      $(document).ready(function(){   

        var userid = $('#userid').val();

    }

</script>

HTML Code

<input type="hidden" name="userid" id="userid" value="8"/>   

Saturday 23 April 2022

Software Development: Iterative and Evolutionary Development

Iterative and Evolutionary Development

  • Involves early programming and testing of a partial system, in repeating cycles.
  • Relies on short quick development steps (or iterations), feedback and adaptation to clarify the requirements and design so successively enlarging and refining a system. 
  • Normally assumes that the development starts before all requirements are defined in detail, feedback is used to clarify and improve the evolving specifications.
  • Each iteration will include requirements, analysis, design, implementation, and test. 
  • Iterative feedback and evolution leads towards the desired system. The requirements and design instability lowers over time.

Current research demonstrates that iterative methods are associated with higher success and productivity rates, and lower defect levels.

Timeboxing

A key idea is that iterations are timeboxed, or fixed in length.

  • Most iterative methods recommend in iteration length between 2 – 6 weeks.
  • If it seems that it will be difficult to meet the deadline, the recommended response is to de-scope

De-scoping: removing tasks or requirements from the iteration, and including them in a future iteration, rather than slipping the completion date.

Iterative and Evolutionary Development (also known as iterative and inceremental development; spiral development and evolutionary development)

Build-Feedback-Adapt Cycles

In complex changing systems, feedback and adaptation are key ingredients for success:

  • Feedback from early development, programmers trying to read specifications, and client demos: to refine the requirements.
  • Feedback from tests and developers : to refine the design and models.
  • Feedback from the progress of the team tackling early features : to refine the schedule and estimates.

Benefits of Iterative development 

  • Less project failure, better productivity, and lower defect rates 
  • Early rather than late mitigation of high risks 
  • Early visible progress 
  • Early feedback, user engagement, and adaptation 
  • Managed complexity: the team is not overwhelmed by “analysis paralysis” or very long and complex steps 
  • The learning within an iteration can be methodically used to improve the development process itself, iteration by iteration. 

The Unified Process is a popular iterative software development process. 

Why a new methodology?

Process-oriented methods:

  • Requirements of a project are completely frozen before the design and development process commences.
  • Not always feasible
  • Need for flexible, adaptable and agile methods, which allow the developers to make late changes in specifications.

Waterfall (Sequential) Lifecycle

  • Promotes big up-front “speculative” requirements and design steps before programming.
  • Historically promoted due to belief or hearsay rather than statistically significant evidence.
  • Success/failure studies show that the waterfall has high failure rates.

Why the waterfall lifecycle fails?

The key false assumption:

  • The specifications are predictable and stable and can be correctly defined at the start, with low change rates.
  • But change is a constant on software projects.
  • A typical software project experienced a 25% change.