|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:
WebRTC sits at the intersection between VoIP and the Web. As such, it poses some interesting challenges for those developing services on top of it, but also for those who need to test and monitor these services. In his session at WebRTC Summit, Tsahi Levent-Levi, co-founder of testRTC, reviewed the various challenges posed by WebRTC when it comes to testing and monitoring and on ways to overcome them.
Oct. 28, 2016 07:00 PM EDT Reads: 4,241
The explosion of new web/cloud/IoT-based applications and the data they generate are transforming our world right before our eyes. In this rush to adopt these new technologies, organizations are often ignoring fundamental questions concerning who owns the data and failing to ask for permission to conduct invasive surveillance of their customers. Organizations that are not transparent about how their systems gather data telemetry without offering shared data ownership risk product rejection, regu...
Oct. 28, 2016 07:00 PM EDT Reads: 394
Join IBM November 2 at 19th Cloud Expo at the Santa Clara Convention Center in Santa Clara, CA, and learn how to go beyond multi-speed it to bring agility to traditional enterprise applications. Technology innovation is the driving force behind modern business and enterprises must respond by increasing the speed and efficiency of software delivery. The challenge is that existing enterprise applications are expensive to develop and difficult to modernize. This often results in what Gartner calls...
Oct. 28, 2016 07:00 PM EDT Reads: 381
Bert Loomis was a visionary. This general session will highlight how Bert Loomis and people like him inspire us to build great things with small inventions. In their general session at 19th Cloud Expo, Harold Hannon, Architect at IBM Bluemix, and Michael O'Neill, Strategic Business Development at Nvidia, will discuss the accelerating pace of AI development and how IBM Cloud and NVIDIA are partnering to bring AI capabilities to "every day," on-demand. They will also review two "free infrastruct...
Oct. 28, 2016 06:30 PM EDT Reads: 371
WebRTC defines no default signaling protocol, causing fragmentation between WebRTC silos. SIP and XMPP provide possibilities, but come with considerable complexity and are not designed for use in a web environment. In his session at @ThingsExpo, Matthew Hodgson, technical co-founder of the Matrix.org, discussed how Matrix is a new non-profit Open Source Project that defines both a new HTTP-based standard for VoIP & IM signaling and provides reference implementations.
Oct. 28, 2016 06:15 PM EDT Reads: 2,938
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.
Oct. 28, 2016 05:30 PM EDT Reads: 3,329
Two weeks ago (November 3-5), I attended the Cloud Expo Silicon Valley as a speaker, where I presented on the security and privacy due diligence requirements for cloud solutions. Cloud security is a topical issue for every CIO, CISO, and technology buyer. Decision-makers are always looking for insights on how to mitigate the security risks of implementing and using cloud solutions. Based on the presentation topics covered at the conference, as well as the general discussions heard between sessi...
Oct. 28, 2016 04:30 PM EDT Reads: 5,256
November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. Penta Security is a leading vendor for data security solutions, including its encryption solution, D’Amo. By using FPE technology, D’Amo allows for the implementation of encryption technology to sensitive data fields without modification to schema in the database environment. With businesses having their data become increasingly more complicated in their mission-critical applications (such as ERP, CRM, HRM), continued ...
Oct. 28, 2016 04:30 PM EDT Reads: 1,230
In his general session at 18th Cloud Expo, Lee Atchison, Principal Cloud Architect and Advocate at New Relic, discussed cloud as a ‘better data center’ and how it adds new capacity (faster) and improves application availability (redundancy). The cloud is a ‘Dynamic Tool for Dynamic Apps’ and resource allocation is an integral part of your application architecture, so use only the resources you need and allocate /de-allocate resources on the fly.
Oct. 28, 2016 04:00 PM EDT Reads: 3,878
SYS-CON Events announced today that Cloudbric, a leading website security provider, 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. Cloudbric is an elite full service website protection solution specifically designed for IT novices, entrepreneurs, and small and medium businesses. First launched in 2015, Cloudbric is based on the enterprise level Web Application Firewall by Penta Security Sys...
Oct. 28, 2016 03:15 PM EDT Reads: 1,384
Virgil consists of an open-source encryption library, which implements Cryptographic Message Syntax (CMS) and Elliptic Curve Integrated Encryption Scheme (ECIES) (including RSA schema), a Key Management API, and a cloud-based Key Management Service (Virgil Keys). The Virgil Keys Service consists of a public key service and a private key escrow service.
Oct. 28, 2016 02:30 PM EDT Reads: 1,250
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.
Oct. 28, 2016 02:15 PM EDT Reads: 4,029
SYS-CON Events announced today that MathFreeOn 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. MathFreeOn is Software as a Service (SaaS) used in Engineering and Math education. Write scripts and solve math problems online. MathFreeOn provides online courses for beginners or amateurs who have difficulties in writing scripts. In accordance with various mathematical topics, there are more tha...
Oct. 28, 2016 02:00 PM EDT Reads: 1,227
In an era of historic innovation fueled by unprecedented access to data and technology, the low cost and risk of entering new markets has leveled the playing field for business. Today, any ambitious innovator can easily introduce a new application or product that can reinvent business models and transform the client experience. In their Day 2 Keynote at 19th Cloud Expo, Mercer Rowe, IBM Vice President of Strategic Alliances, and Raejeanne Skillern, Intel Vice President of Data Center Group and ...
Oct. 28, 2016 01:45 PM EDT Reads: 1,727
The best way to leverage your Cloud Expo presence as a sponsor and exhibitor is to plan your news announcements around our events. The press covering Cloud Expo and @ThingsExpo will have access to these releases and will amplify your news announcements. More than two dozen Cloud companies either set deals at our shows or have announced their mergers and acquisitions at Cloud Expo. Product announcements during our show provide your company with the most reach through our targeted audiences.
Oct. 28, 2016 01:30 PM EDT Reads: 5,202
@ThingsExpo has been named the Top 5 Most Influential Internet of Things Brand by Onalytica in the ‘The Internet of Things Landscape 2015: Top 100 Individuals and Brands.' Onalytica analyzed Twitter conversations around the #IoT debate to uncover the most influential brands and individuals driving the conversation. Onalytica captured data from 56,224 users. The PageRank based methodology they use to extract influencers on a particular topic (tweets mentioning #InternetofThings or #IoT in this ...
Oct. 28, 2016 01:15 PM EDT Reads: 8,656
There is growing need for data-driven applications and the need for digital platforms to build these apps. In his session at 19th Cloud Expo, Muddu Sudhakar, VP and GM of Security & IoT at Splunk, will cover different PaaS solutions and Big Data platforms that are available to build applications. In addition, AI and machine learning are creating new requirements that developers need in the building of next-gen apps. The next-generation digital platforms have some of the past platform needs a...
Oct. 28, 2016 01:00 PM EDT Reads: 2,430
"We've discovered that after shows 80% if leads that people get, 80% of the conversations end up on the show floor, meaning people forget about it, people forget who they talk to, people forget that there are actual business opportunities to be had here so we try to help out and keep the conversations going," explained Jeff Mesnik, Founder and President of ContentMX, in this SYS-CON.tv interview at 18th Cloud Expo, held June 7-9, 2016, at the Javits Center in New York City, NY.
Oct. 28, 2016 01:00 PM EDT Reads: 3,730
Intelligent machines are here. Robots, self-driving cars, drones, bots and many IoT devices are becoming smarter with Machine Learning. In her session at @ThingsExpo, Sudha Jamthe, CEO of IoTDisruptions.com, will discuss the next wave of business disruption at the junction of IoT and AI, impacting many industries and set to change our lives, work and world as we know it.
Oct. 28, 2016 12:30 PM EDT Reads: 663
More and more brands have jumped on the IoT bandwagon. We have an excess of wearables – activity trackers, smartwatches, smart glasses and sneakers, and more that track seemingly endless datapoints. However, most consumers have no idea what “IoT” means. Creating more wearables that track data shouldn't be the aim of brands; delivering meaningful, tangible relevance to their users should be. We're in a period in which the IoT pendulum is still swinging. Initially, it swung toward "smart for smar...
Oct. 28, 2016 12:15 PM EDT Reads: 1,313