|By Hovhannes Avoyan||
|September 13, 2012 11:16 AM EDT||
This brief tutorial will enable web application developers to harness the power of cloud computing database, Xeround, with the best PHP MVC framework in town, CodeIgniter.
Xeround is an Israeli web startup, launched back in 2005. It specializes in cloud database software technologies, operating in the PaaS domain. Xeround is primarily known for its MySQL cloud database, which it provides with a seamless frontend application. Its unique selling point is the ability to easily scale MySQL application on multiple platforms like Amazon EC2 and Rackspace. Xeround is positioned well in the MySQL cloud database market. Xeround’s basic MySQL cloud database plan is free and pretty fast.
CodeIgniter on the other hand is an Open Source PHP MVC (Model View Controller) framework used to make high end and enterprise level web applications. The framework uses a popular MVC software design pattern, popular with most of the top web developers today. The high points of using CodeIgniter as your web application framework are massive, such as highly organized code, rapid application development and plethora of in built tools.
What will this tutorial teach you?
This tutorial aims to teach you to setup up a basic CodeIgniter application in conjunction with the Xeround cloud database, powered by Oracle’s MySQL.
What will this tutorial NOT teach you?
This tutorial will NOT teach you to use CodeIgniter, MySQL, Phpmyadmin, FTP, HTML, CSS, XAMPP or the web stack.
So in a nutshell?
It rather enables you to learn the processes involved in helping you setup your next web application using CodeIgniter with a Xeround backend.
What will you need?
- An Internet connection, preferably fast.
- A working installation of XAMPP. You can download one here.
Setting up CodeIgniter
With your XAMPP already installed and configured on your computer (Windows, Mac or Linux), you active it by following these steps.
- Launch XAMPP application by clicking on this icon on your desktop.
- Now, ensure the first two features on the control panel are active. In order to enable Apache and MySQL, just click the Start buttons beside them and their status-es should turn green. That’s it. You’re on localhost.
- Now, open up your favorite browser, preferably Google Chrome and type in the following text in the address bar: localhost. If that doesn’t work, type in 127.0.0.1. If everything went well previously, you should see something like this. (Obviously, if you have Linux or Windows, it will mention XAMPP for X OS).
Now, lets setup CodeIgniter. The first thing you should do is visiting Ellis Lab’s CodeIgniter page by click here. When on the home page, click on the download button on the right side. Now its time to unzip.
Once the compressed file is unzipped, name it anything you like. We have named it “CodeIgniterApp”. It is important to clean the folder of any junk, by deleting the license.txt and the user guide files. You wont need those.
To enable your CodeIgniter app to work on the localhost, which is a simulation of a website on a host, you need to copy it to your htdocs.
To do this, follow the directory structure to access your htdocs folder.
Now, just drag and drop the “CodeIgniterApp” folder into htdocs. To ensure everything went fine, open up your browser and type in localhost/CodeIgniterApp. If successful, you should see this page and probably celebrate.
At this point in time, the CodeIgniter has been successfully setup. However, it doesn’t require a database to function just to load up a simple dynamic Welcome page. As the objective of our tutorial is to use CodeIgniter with Xeround, let’s take a break from the CodeIgniter side of things and create an Account on Xeround.
Setting up Xeround
As mentioned before, Xeround offers cloud database services for MySQL that are highly scalable with top notch companies providing instances such as Amazon and Rackspace.
Note: This part of the tutorial will create a sample Xeround account. The username and password will not be disclosed.
- First things first. Visit http://xeround.com/ to access the Xeround site. The home page pretty much summarizes the things we have discussed so far, such as scalability, availability and simplicity.
- Using the navigation bar on top, click sign up. Alternatively, you can click here. Enter your details and in the ‘Expected DB Size’ field, select Less than 0.5 GB. This is well good enough for a starter.
- Now, check your email for the confirmation link that was sent to you. At this point in time, you don’t have to choose the password. That comes later when you click the confirmation link.
- Once you have set the password after clicking the confirmation link, you will be welcomed to the Xeround’s primary dashboard. This can be accessed at https://cloud.xeround.com as well.
- To create your new Cloud Database in minutes, follow these steps:
- Choose to create your database Instance.
- Choose the free 10 MB Xeround FREE plan. You get:
a) Shared Environment
b) High Availability Guaranteed
c) Throughput: up to 1MB/s
d) Connections: up to 5
- Now you will be asked to choose your Data Centre. We recommend Amazon EC2. It’s the best in the business right now. Highly reliable!
- The last step for creating your DB Instance asks you to fill in some crucial details. These may be the most important details of all. They are essential to get your web application up and running on a MySQL backend.
Here is a sample of what we’ve filled in for this tutorial account:
- Once every detail has been carefully filled in and stored in your memory, remember to do one last thing. Yes, you guessed it right. Click the big blue button that says Create.
- Once you have clicked Create, a dialog box will show up saying “DB Instance creation is in progress”. Just close. The DB Instance has been created by now.
- The DB Management Dashboard now looks something like this, as shown in the image below. Explaining all the features of the dashboard is beyond the scope of this tutorial.
- Now, click the link under external DNS Hostname and login to your Phpmyadmin. Once there, create yourself a database. We named ours ‘neil’. At this moment, just take note of your: Database name, user, pass and external DNS Hostname
Connecting Xeround with CodeIgniter
Now that we have our Xeround database setup, it is time to connect the database with CodeIgniter.
- Open the CodeIgniterApp folder that you placed earlier in the htdocs directory. Access the database.phpfile by following the directory structure: CodeIgniterApp/application/config/database.php
- Once you are in the file database.php, scroll down to line 51. Can you see the fields for hostname, username, password and database?
Currently, they are set to localhost but since we want Xeround, we would need to add the details in the blank spaces using the notes we took earlier. By the way, Xeround works on localhost and web!
So based on the tutorial account details, it looks like this once its filled:
$db['default']['hostname'] = instance26267.db.xeround.com:16438;
$db['default']['username'] = ‘user’;
$db['default']['password'] = ‘pass’;
$db['default']['database'] = ‘neil’;
Note: Although you do not have access to the tutorial Xeround account we created, you can still use these database instance details. However, we recommend you create your own. This is only for demonstration purposes.
Tip: In order to avoid lagging, it is better to disable persistent connections within your CodeIgniter application by editing line 57 of database.php. You simply have to set $db['default']['pconnect'] = FALSE; to false. This ensures that there are no lags, since there is a limit of 5 connections in the Xeround FREE plan.
Congratulations. You have successfully completed the essential portion of the tutorial. You have connected your Xeround Cloud Database with your CodeIgniter application. What’s next? Well, its time for some testing.
Testing your application
Lets create a sample table structure.
- Go to application/controllers/ and create a controller: tables.php.
- Add the following code and save it. The code is already supplied in the zip folder attached with this tutorial (namely CodeIgniterApp.zip).
So what this does is basically creates a Controller called Tables, loads the DBForge class of CodeIgniter (used to create tables) and creates a table called Test_Table. If returns messages on the success or failure.
- Run the tables’ controller by type in the following address in your favorite browser’s address bar: http://localhost/CodeIgniterApp/index.php/tables
- You should now see a message on your browser that says that the table “Test Table” has been created successfully. You can even confirm this by going back to your Phpmyadmin dashboard.
Now lets try adding some real world data into our table. To do that, we will create a small application that stores users’ first and last name. Since the scope of the tutorial is not to teach CodeIgniter or programming whatsoever, the files have been supplied to enable you to learn. The end result of the small application is shown below.
Oh by the way, don’t forget to turn on the following autoload.php options by going into CodeIgniterApp/application/config/autoload.php:
You can get the sample code used in this article hereShare Now:
DevOps at Cloud Expo, taking place Nov 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA, is co-located with 19th Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The widespread success of cloud computing is driving the DevOps revolution in enterprise IT. Now as never before, development teams must communicate and collaborate in a dynamic, 24/7/365 environment. There is no time to wait for long dev...
Aug. 24, 2016 05:00 AM EDT Reads: 2,036
Amazon has gradually rolled out parts of its IoT offerings in the last year, but these are just the tip of the iceberg. In addition to optimizing their back-end AWS offerings, Amazon is laying the ground work to be a major force in IoT – especially in the connected home and office. Amazon is extending its reach by building on its dominant Cloud IoT platform, its Dash Button strategy, recently announced Replenishment Services, the Echo/Alexa voice recognition control platform, the 6-7 strategic...
Aug. 24, 2016 04:30 AM EDT Reads: 2,158
19th Cloud Expo, taking place November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA, will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud strategy. Meanwhile, 94% of enterpri...
Aug. 24, 2016 03:30 AM EDT Reads: 2,899
Akana has announced the availability of version 8 of its API Management solution. The Akana Platform provides an end-to-end API Management solution for designing, implementing, securing, managing, monitoring, and publishing APIs. It is available as a SaaS platform, on-premises, and as a hybrid deployment. Version 8 introduces a lot of new functionality, all aimed at offering customers the richest API Management capabilities in a way that is easier than ever for API and app developers to use.
Aug. 24, 2016 02:00 AM EDT Reads: 1,384
Personalization has long been the holy grail of marketing. Simply stated, communicate the most relevant offer to the right person and you will increase sales. To achieve this, you must understand the individual. Consequently, digital marketers developed many ways to gather and leverage customer information to deliver targeted experiences. In his session at @ThingsExpo, Lou Casal, Founder and Principal Consultant at Practicala, discussed how the Internet of Things (IoT) has accelerated our abil...
Aug. 24, 2016 01:45 AM EDT Reads: 1,848
With so much going on in this space you could be forgiven for thinking you were always working with yesterday’s technologies. So much change, so quickly. What do you do if you have to build a solution from the ground up that is expected to live in the field for at least 5-10 years? This is the challenge we faced when we looked to refresh our existing 10-year-old custom hardware stack to measure the fullness of trash cans and compactors.
Aug. 24, 2016 01:00 AM EDT Reads: 1,572
The emerging Internet of Everything creates tremendous new opportunities for customer engagement and business model innovation. However, enterprises must overcome a number of critical challenges to bring these new solutions to market. In his session at @ThingsExpo, Michael Martin, CTO/CIO at nfrastructure, outlined these key challenges and recommended approaches for overcoming them to achieve speed and agility in the design, development and implementation of Internet of Everything solutions wi...
Aug. 24, 2016 12:30 AM EDT Reads: 1,846
Cloud computing is being adopted in one form or another by 94% of enterprises today. Tens of billions of new devices are being connected to The Internet of Things. And Big Data is driving this bus. An exponential increase is expected in the amount of information being processed, managed, analyzed, and acted upon by enterprise IT. This amazing is not part of some distant future - it is happening today. One report shows a 650% increase in enterprise data by 2020. Other estimates are even higher....
Aug. 24, 2016 12:00 AM EDT Reads: 2,800
I wanted to gather all of my Internet of Things (IOT) blogs into a single blog (that I could later use with my University of San Francisco (USF) Big Data “MBA” course). However as I started to pull these blogs together, I realized that my IOT discussion lacked a vision; it lacked an end point towards which an organization could drive their IOT envisioning, proof of value, app dev, data engineering and data science efforts. And I think that the IOT end point is really quite simple…
Aug. 23, 2016 11:30 PM EDT Reads: 2,206
Internet of @ThingsExpo, taking place November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA, is co-located with 19th Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The Internet of Things (IoT) is the most profound change in personal and enterprise IT since the creation of the Worldwide Web more than 20 years ago. All major researchers estimate there will be tens of billions devices - comp...
Aug. 23, 2016 11:00 PM EDT Reads: 3,482
"My role is working with customers, helping them go through this digital transformation. I spend a lot of time talking to banks, big industries, manufacturers working through how they are integrating and transforming their IT platforms and moving them forward," explained William Morrish, General Manager Product Sales at Interoute, in this SYS-CON.tv interview at 18th Cloud Expo, held June 7-9, 2016, at the Javits Center in New York City, NY.
Aug. 23, 2016 09:00 PM EDT Reads: 2,972
Internet of @ThingsExpo, taking place November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA, is co-located with the 19th International Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world and ThingsExpo Silicon Valley Call for Papers is now open.
Aug. 23, 2016 08:45 PM EDT Reads: 3,747
Today we can collect lots and lots of performance data. We build beautiful dashboards and even have fancy query languages to access and transform the data. Still performance data is a secret language only a couple of people understand. The more business becomes digital the more stakeholders are interested in this data including how it relates to business. Some of these people have never used a monitoring tool before. They have a question on their mind like “How is my application doing” but no id...
Aug. 23, 2016 08:15 PM EDT Reads: 1,632
The 19th International Cloud Expo has announced that its Call for Papers is open. Cloud Expo, to be held November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA, brings together Cloud Computing, Big Data, Internet of Things, DevOps, Digital Transformation, Microservices and WebRTC to one location. With cloud computing driving a higher percentage of enterprise IT budgets every year, it becomes increasingly important to plant your flag in this fast-expanding business opportuni...
Aug. 23, 2016 07:00 PM EDT Reads: 3,798
SYS-CON Events announced today that Venafi, the Immune System for the Internet™ and the leading provider of Next Generation Trust Protection, will exhibit at @DevOpsSummit at 19th International Cloud Expo, which will take place on November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. Venafi is the Immune System for the Internet™ that protects the foundation of all cybersecurity – cryptographic keys and digital certificates – so they can’t be misused by bad guys in attacks...
Aug. 23, 2016 02:15 PM EDT Reads: 2,500
Smart Cities are here to stay, but for their promise to be delivered, the data they produce must not be put in new siloes. In his session at @ThingsExpo, Mathias Herberts, Co-founder and CTO of Cityzen Data, will deep dive into best practices that will ensure a successful smart city journey.
Aug. 23, 2016 01:45 PM EDT Reads: 1,410
SYS-CON Events announced today that 910Telecom will exhibit at the 19th International Cloud Expo, which will take place on November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. Housed in the classic Denver Gas & Electric Building, 910 15th St., 910Telecom is a carrier-neutral telecom hotel located in the heart of Denver. Adjacent to CenturyLink, AT&T, and Denver Main, 910Telecom offers connectivity to all major carriers, Internet service providers, Internet backbones and ...
Aug. 23, 2016 01:15 PM EDT Reads: 1,717
In today's uber-connected, consumer-centric, cloud-enabled, insights-driven, multi-device, global world, the focus of solutions has shifted from the product that is sold to the person who is buying the product or service. Enterprises have rebranded their business around the consumers of their products. The buyer is the person and the focus is not on the offering. The person is connected through multiple devices, wearables, at home, on the road, and in multiple locations, sometimes simultaneously...
Aug. 23, 2016 09:30 AM EDT Reads: 2,224
For basic one-to-one voice or video calling solutions, WebRTC has proven to be a very powerful technology. Although WebRTC’s core functionality is to provide secure, real-time p2p media streaming, leveraging native platform features and server-side components brings up new communication capabilities for web and native mobile applications, allowing for advanced multi-user use cases such as video broadcasting, conferencing, and media recording.
Aug. 23, 2016 06:45 AM EDT Reads: 2,040
Data is the fuel that drives the machine learning algorithmic engines and ultimately provides the business value. In his session at Cloud Expo, Ed Featherston, a director and senior enterprise architect at Collaborative Consulting, will discuss the key considerations around quality, volume, timeliness, and pedigree that must be dealt with in order to properly fuel that engine.
Aug. 23, 2016 06:45 AM EDT Reads: 1,628