Database Backups in Game
- Foofighter
- Posts: 121
- Joined: Sun Mar 04, 2012 1:52 pm
Database Backups in Game
Hi Guys,
Iam quite unsure how often i should run a DB backup cron, anyone got experience whats a got value for it?
Foo
Iam quite unsure how often i should run a DB backup cron, anyone got experience whats a got value for it?
Foo
- vitinho444
- Posts: 2819
- Joined: Mon Mar 21, 2011 4:54 pm
Re: Database Backups in Game
well, sorry if im not the best person to answer to you, but i think it depends.
Im almost launching the BETA for my Browser based and before read your post i was not thinking about that
But now, i think it depends on the quality of your server and your code security..
Per example: Your server is not that good.. maybe the database backup should be like everyday...
But if you got everything 100% setup.. i think once a week its good.
In my game i will make a sort of inspection every weekend searching for bugs, errors (i made a error log system) and maybe make a backup manually...
Srry if im not much of a pro but i hope you find my reply usefull
Im almost launching the BETA for my Browser based and before read your post i was not thinking about that
But now, i think it depends on the quality of your server and your code security..
Per example: Your server is not that good.. maybe the database backup should be like everyday...
But if you got everything 100% setup.. i think once a week its good.
In my game i will make a sort of inspection every weekend searching for bugs, errors (i made a error log system) and maybe make a backup manually...
Srry if im not much of a pro but i hope you find my reply usefull
-
alexrules01
- Posts: 175
- Joined: Sun Oct 11, 2009 9:33 am
Re: Database Backups in Game
Everyday. I know if I was playing a game, and I lost a weeks worth of work, I'd be pretty ticked off. Problems may happen at anytime, so do the sure thing and backup everyday!
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Database Backups in Game
For most games it is going to be at least every day. The general idea is that however long you wait between backups is the amount of data you are risking to loss. Every server or service is always at risk of HDD failure. So how much could you lose without losing your players, losing valuable info, etc.? For most devs of even semi-popular games, the answer is really "none". Of course, since it isn't efficient to backup your database every 5 seconds, I would suggest to do it as often as possible without negatively impacting your game. Doing it every couple of minutes would likely cause lag issues as the database would be under constant stress once it got very large. Just tinker with it, but I would honestly lean towards more backups, definitely. Some hosting services have a maximum amount of backups over a time period, and quite often you will want to just take the maximum.
The indelible lord of tl;dr
- vitinho444
- Posts: 2819
- Joined: Mon Mar 21, 2011 4:54 pm
Re: Database Backups in Game
Then everyday is the answer?
I think that to cause the minimum problems on the game is to backup on that time that has low traffic.
I think that to cause the minimum problems on the game is to backup on that time that has low traffic.
Re: Database Backups in Game
It would be awesome if there were functionality to store changes within the database between backups. For example log all the queries since the last backup or something. Would reduce the need for frequent backups.
Fighting for peace is declaring war on war. If you want peace be peaceful.
- vitinho444
- Posts: 2819
- Joined: Mon Mar 21, 2011 4:54 pm
Re: Database Backups in Game
Chris you can easily make a query log...
When you do a query in php after it just add that query info to the log (can be in another database or a local file) and here u have, right?
When you do a query in php after it just add that query info to the log (can be in another database or a local file) and here u have, right?
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Database Backups in Game
MS SQL Server has a feature like that, actually. You can setup your backups to just sync with changes to the database, so it is basically just like having a 2nd live database, and then make full back-ups periodically from the 2nd one.Chris wrote:It would be awesome if there were functionality to store changes within the database between backups. For example log all the queries since the last backup or something. Would reduce the need for frequent backups.
The indelible lord of tl;dr
Re: Database Backups in Game
Cool, I'm working with an automated relationship system built on-top of MS SQL called xRM. I'll have to write a program where I build my own database and queries sometime, maybe with the .NET WebForms idea, I find it hard to except where the business logic takes place. I find the xRM system works much better with an MVC framework when working with .NET as you can link the models for the MVC framework and the entities received from the xRM system in a really efficient way using method decorators on your controllers. This should help with the step over to WebServices and further onto the new features in .NET 4.5
Fighting for peace is declaring war on war. If you want peace be peaceful.
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Database Backups in Game
Have you checked out the Entity Framework? I am sure there is more to what you are working on then you can sum up in just a sentence or two, but it sounds a lot like the Entity Framework. Maybe you could work off of EF and it could save you some time?
The indelible lord of tl;dr