Solved

How to keep running a Web application when offline

Posted on 2013-05-24
11
161 Views
Last Modified: 2014-02-03
Dear Experts,
I am building an online booking system and would like to know what is the best way to tackle this problem. The booking application is always going be accessed by the ticket office staff and not the end users. The internet connection at the ticket office can drop intermittently for few minutes. I don't want the booking system to be unavailable during this period. I want to make sure the web application is able to run offline more for a short period without affecting the on going transaction or the bookings. Application will be using a Mysql Database.
Can someone please enlighten me on what's the best way to do this or guide me on the right direction?
Thanks.
0
Comment
Question by:Herci
  • 3
  • 3
  • 2
  • +3
11 Comments
 
LVL 7

Expert Comment

by:ded_ch
ID: 39195648
PHP is a server based scripting language. This means, code is always run on the server side. So no offline support exists for PHP.
You would need a client based scripting language, such as activeX or Java
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39195687
Or put the application on a server in the ticket office that gets updates from the online system.  I think that's what I would do.
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 39195690
To add to what ded_ch correctly pointed out, most client-side scripting languages will expect and require timely communication with the server.  The server is where the MySQL database will reside.  So the only possible solution is to fix the internet connection, perhaps by getting a redundant data pipe of some sort.
0
 
LVL 20

Accepted Solution

by:
Mark Brady earned 400 total points
ID: 39196551
All good suggestions above by the way. A few years ago I did something similar. I had a local server (in my office) which you can setup in less than an hour. On that server I had a booking system that I wrote. All you need to do then is to have a script that is run by cron job that runs (in my case once every two minutes) that logs onto your online database and gets any new records and updates your local server. It all depends on where the main bookings will be done from

I would imagine they would be done online so if you reverse my logic then you have a script on your local server that would check for new records on line and update the local database.

It's quite easy to do. That way if the online website goes down or is not available you can log onto your local server and continue making bookings. It is called a sync system whereby it will sync data both ways. Your online server is constantly updated and so is your local server.

It would take a bit of planning but that is how I would tackle the job.
0
 
LVL 33

Expert Comment

by:Slick812
ID: 39196887
greetings   Herci, , You leave too much information Unknown, to give a specific answer, It seems that you would not need a internet "Server" to do this, ,  if all of your " ticket office staff" were in the same location, if they are in the same location, then you do not need an "Internet Server" but a local server, as several comments here have already told you about.

If your " ticket office staff" are NOT all in the same location, then you need an Internet connection "Server" , , and you can NOT have a PHP site that has the "Offline" mode, as several comments here have told you.
You will need to change your HOST for your internet "Server" from the unreliable one you use now, , to one that is near 99.9 % always online, with is Most of the Hosts (even the cheep ones).
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:Herci
ID: 39203144
Thanks for all the suggestions.
Slick - The ticket office staff could be in different rooms in the same location or could be in different geographic locations.

elvin - Main booking will be done via the online system. I thought about the same idea you've suggested but I wasn't sure whats the best way to do it. What I am not sure about is, if there are 5 booking machines in the booking office, I need to make one of them a local server. When the internet goes down I will be able to use the local server to take booking and not the other 4 machines? If the staff want to keep using all the machines for taking bookings, then do I need to make each machine a local server? Also are there any security implication of having a local server/DB?
0
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 100 total points
ID: 39203250
If the staff are different geographic locations, then there is no point to creating a 'local server' to avoid outages because it would be necessary to use the internet from the different geographic locations to get to it anyway.
0
 
LVL 20

Assisted Solution

by:Mark Brady
Mark Brady earned 400 total points
ID: 39203275
Ok I think we are all getting a small idea on what you want but could you possibly extend our knowledge on exactly how you system is setup? So when you say booking machines you mean pc's right?

If so, then yes you could have a local server setup which hosts your booking program. That machine will have an ip in which other local pc's on that network (internal mainly but you could setup a VPN as well). They all log onto the same system in one building for example.

In that case, who cares if the internet goes down because everything is on you local server. I'm guessing that is not the case but do go ahead and enlighten us on how this structure is put together so we may advise you as best we can.

Cheers
Elvin
0
 

Author Comment

by:Herci
ID: 39214876
Elvin- There are going to be about 6 desktop PCs and several tablets in the booking office. All these machines will be used for taking bookings. There will also be an online site for the home users to make bookings. All these bookings will go into a central database.
I think as you've suggested, having a local server would be a good idea. We can then allow the PCs and tablets to take the bookings via the local site. We can then have a cron job to push the local bookings up to the central server. We can also have a cron job to download the ticket availability information from the central DB to the local DBs. This way the central database and the local databases will have an up to date ticket availability information. Of course, if the internet is down, then the cron jobs won't work. But as soon as the internet is back on, it should update the records. At the moment I am assuming the internet won't be down for over 48 hours in a single stretch.
What do you think? Does it sound like a good structure?
0
 
LVL 20

Assisted Solution

by:Mark Brady
Mark Brady earned 400 total points
ID: 39216783
Yeah I think so. The internet would never go down for that long unless you had a very poor hosting company. I am with inmotionhosting.com and we have had 1 outage for an hour about two years ago. I've been with them for 5 years.

Yes a simple cron job would keep your databases in sync. I run a similar sync system on my servers every two minutes as I have a busy commercial website.
0
 

Author Closing Comment

by:Herci
ID: 39829018
Thanks everyone.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

#Citrix #Internet Explorer #Enterprise Mode #IE 11 #IE 8
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now