5. EL RENDIMIENTO ESCOLAR LA INFLUENCIA DEL ENTORNO
5.1. Análisis de Correlación
5.1.3. Grado de asociación entre las variables del alumno y el rendimiento escolar
The Web Servers
Moving your Web servers to EC2 is fairly simple. You can set up EC2 images that are configured exactly the same way your current Web servers are.
Tip: If you require a queuing service as part of your architecture, con- sider switching to Amazon’s SQS to make administration easier.
EC2 instances are virtual private servers that have some risk associated with them; if they crash, you can lose your data if you haven’t made appro- Figure 6.15 Create Directory in an S3 Bucket.
Figure 6.16 Cloudberry Explorer for Amazon S3.
priate provisions. Since you are building an architecture on a transient sys- tem, you are forced to think about flexibility, backups, and adaptability early in the development cycle. Amazon Elastic Block Store (EBS) provides block level storage volumes for use with Amazon EC2 instances. Amazon EBS volumes are off-instance storage that persists independently from the life of an instance. Amazon Elastic Block Store provides highly available, highly reliable storage volumes that can be attached to a running Amazon EC2 instance and exposed as a device within the instance. Amazon EBS is particularly suited for applications that require a database, file system, or access to raw block level storage.
Tip: If you wait until you must grow to think about how you’re going to grow or migrate your system from one machine to another, you haven’t done yourself any favors. Building on AWS puts building for resilience in the face of system failure at the top of your priority list, where it should be anyway. Using Elastic Block Storage (see below) goes a long way toward mitigating the risks associated with potential failure of an instance.
Let’s do it.
Go to the Amazon EC2 Console Dashboard (https://console.aws.ama- zon.com/ec2/home) The screen should look something like the screenshot in Figure 6.18.
Click the Launch Instance Button.
Choose an Amazon Machine Image (AMI) as shown in Figure 6.19. We will select the LAMP Web Starter, a common image, of free, open source software, originally coined from the first letters of Linux (operating Figure 6.18 Amazon EC2 Console Dashboard.
system), Apache HTTP Server, MySQL (database software), and PHP, Python, or Perl (scripting language)by clicking Select.
Next, we select the number of instances (easily changed), the availabil- ity zone (we will choose us-east-1a), and the type of instance we need (see
Figure 6.20).
A default “small instance” of EC2 provides: 1.7 GB memory
Figure 6.19 AWS Request Instances Wizard—1.
1 EC2 Compute Unit (1 virtual core with 1 EC2 Compute Unit) 160 GB instance storage (150 GB plus 10 GB root partition) 32-bit platform
I/O Performance: Moderate API name: m1.small
A large range of other instances can be selected to scale from this basic configuration. These provide more memory, more compute power, a 64-bit platform, enhanced I/O performance, and the like.
You can use a preconfigured software configuration running Linux, Windows, Sun or almost anything else. On-demand servers are available in three sizes, seven configurations, and with the operating system of your choice.
In addition to providing the flexibility to easily choose the number, the size and the configuration of the compute instances you need for your appli- cation, Amazon EC2 providesthree different purchasing models that give you the flexibility to optimize your costs.
On-Demand Instances allow you to pay a fixed rate by the hour with no commitment
Reserved Instances allow you to pay a one-time fee and in turn receive a significant discount on the hourly usage charge for that instance
Spot Instances enable you to bid whatever price you want for instance capacity, providing for even greater savings if your appli- cations have flexible start and end times.
Tip: Consider using Amazon’s availability zones to set up servers in dif- ferent availability zones. This can help your serve customers at different parts of the worlds better, while making your infrastructure tolerant to the unlikely event of a datacenter failures at Amazon.
We will choose a Small instance and click Continue Next, select Advanced Instance Options (see Figure 6.21).
In this example, we can live with the defaults, so we just click Con- tinue.
Next, we enter a name for the key pair identifying this instance, and click to create the key pair (as shown in Figure 6.22).
The key pair is created and downloaded to an encrypted file called a PEM file. It should be stored in a safe place. We can configure the firewall (port access) or use the default. We will accept the default. A review screen (Figure 6.23) shows us the results of our handiwork.
Figure 6.21 Advanced Instance Options.
Press Launch, and it’s done.
6.7 Moving The Database
Moving your database to EC2 is probably the hardest part of the move to AWS. If you plan on keeping your database (as opposed to migrating to a cloud solution like SimpleDB), which is what I would recommend for maintaining vendor independence, you should use EBS (Elastic Block Storage) so that your storage persists independently from the life of your EC2 instance. RDS, a good Amazon-specific solution is described in Chapter 12 and addresses the persistance issue.
Tip: Features of Amazon EBS volumes
Amazon EBS allows you to create storage volumes from 1 GB to 1 TB that can be mounted as devices by Amazon EC2 instances. Multiple volumes can be mounted to the same instance
Storage volumes behave like raw, unformatted block devices, with user-supplied device names and a block device interface. You can Figure 6.23 Review of Instance Characteristics.
create a file system on top of Amazon EBS volumes or use them in any other way you would use a block device (like a hard drive) Amazon EBS volumes are placed in a specific Availability Zone and can then be attached to instances also in that same Availability Zone
Each storage volume is automatically replicated within the same Availability Zone. This prevents data loss due to failure of any sin- gle hardware component
Amazon EBS also provides the ability to create point-in-time snap- shots of volumes, which are persisted to Amazon S3. These snap- shots can be used as the starting point for new Amazon EBS volumes and protect data for long-term durability. The same snap- shot can be used to instantiate as many volumes as you wish CloudFront lets you keep multiple copies in different zones
6.8 Using EBS for MySQL
The popular MySQL database included in the LAMP Web Starter runs well on EBS as does RDS (see Chapter 12). Some popular features include:
Persistent storage in the event of instance failure—If an EBS volume is used as the storage for a MySQL database, then the data is pro- tected from instance termination or failure. You can simply attach/ mount the volume on another instance and MySQL will run its normal recovery procedures to bring the database up to date with the binary logs
Safety and replication—According to Amazon, “EBS volume data is replicated across multiple servers.” This makes your data safer than the default instance storage
Improved performance—Studies on EBS disk IO performance indi- cate that EBS IO rates can be several times faster than ephemeral storage and even local disk IO. This has obvious benefits for data- bases, which are often IO bound
Large data storage capacity—EBS volumes can be up to 1TB in size. In theory, you can support an even larger database with LVM or RAID across EBS volumes, or by placing different databases or table files on different EBS volumes. As always, paying attention to building your keys properly is essential for good performance
Instance type portability—If you find that your current small EC2 instance is not able to handle your growing demand, you could
switch the EBS volume holding your MySQL database to one run- ning an extra large instance in a matter of seconds without having to copy the database across the network. You can also downgrade instance types later to save money
Fast and easy backups—EBS snapshots alone could be a sufficiently attractive reason to move a database server to Amazon EC2. Being able to take live, consistent, binary snapshots of the database in just a few seconds is a thing of beauty. Add in the ability to create a new EBS volume from a snapshot so another EC2 instance can run against an exact copy of that database . . . and you’ve opened up new worlds of possibilities
AWS also enables you to create new volumes from AWS-hosted public data sets.11
Tip: Examples of popular public data sets include:
Annotated Human Genome Data, provided by ENSEMBL. The Ensembl project produces genome databases for human as well as almost 50 other species, and makes this information freely available.
Various U.S. Census Databases from The U.S. Census Bureau United States demographic data from the 1980, 1990, and 2000 U.S. Censuses, summary information about Business and Industry, and 2003–2006 Economic Household Profile Data.
UniGene provided by the National Center for Biotechnology Information
A set of transcript sequences of well-characterized genes and hun- dreds of thousands of expressed sequence tags (EST) that provide an organized view of the transcriptome.
Freebase Data Dump from Freebase.com
A data dump of all the current facts and assertions in the Free- base system. Freebase (www.freebase.com/) is an open database of the world’s information, covering millions of topics in hundreds of categories. Drawing from large open data sets like Wikipedia, MusicBrainz, and the SEC archives, it contains structured
information on many popular topics, including movies, music, people and locations—all reconciled and freely available.
Backup.—You can take scheduled snapshots of your EBS and store them on S3.
Tip: Consider replication and sharding. If you’re using availability zone, you should consider sharding your data. For example, store data for European accounts data in Europe only. You should also consider replication between the different availability zones to ensure keep your site available even when one of the datacenter is unavailable.