|
|
1
|
2
|
3
|
4
|
5
|
6
|
|
7
|
8
|
9
|
10
|
11
|
12
|
13
|
|
14
|
15
|
16
|
17
|
18
|
19
|
20
|
|
21
|
22
|
23
|
24
|
25
|
26
|
27
|
|
28
|
29
|
30
|
31
|
|
|
|
|
|
|
|
|
#1241 - 11/27/07 09:39 PM
How databases work: by BERGDAL
|
RHQ Community Moderator
journeyman
Registered: 06/09/07
Posts: 60
Loc: Florida, USA
|
DB 101, how databases work:
(P.S. for the computer geeks out there, I am trying to simplify this for everyone else to understand, so no need to pick at my choices of words lol)
Any information you want to save on a computer has to be moved from active memory (RAM) to long term memory (disc storage). This is done in packets of information whenever the program you're running is set to transfer its active memory to the database. The program needs to copy the active memory, and then write it to the database on the disc drive. This can only be done when the active memory is not changing.
In a database, unlike most other programs, this happens quite often in little chunks. In something like Word, unless you have it set to save automatically, anything you have written will stay in active memory until you click "save" or exit and save. If your computer or program crashes, you risk losing EVERYTHING you have written. A database is set to write data much more often, so you have a much smaller risk of lost data, only the most recently changed info would be lost. This is assuming the program or computer crashed, and the database was not corrupted.
When something goes wrong with the database itself, and it becomes corrupted, you may be able to recover most of your data in a couple different ways. One is to restore from a backup copy of the database. If you do this, you get all the data from when the last backup was made, and nothing after that. Backups typically are done on a daily basis for most dbs, tho this can be more (or less) often. Problem is that you need to stop whatever you are doing with your program while the db is being backed up, so the more often you back it up, the slower your program runs.
A method used to protect data more often than just the "daily" backup is called transaction logs. A program can keep a record of what has changed, and save a backup copy of that, and if the database becomes corrupted it can then possibly be restored to a time after the last full backup. To do this you need to first restore your last backup, then restore any transaction logs one at a time, check to make sure the log does not containe the problem data, restore the next, etc. Untill you restore and check it, you cannot know exactly which of your logs contains the bad data. Once you have restored to where your data is BAD again, you start all over, and stop one log earleir. Now you have only lost any data after the last good transaction log. You also have spent many hours of possibly days getting your data restored and checked.
In Realm, most of the time when there is a crash, it is the program not the database that is at issue, so when the game comes back up our data (toons, houses, equipment etc. are at the exact state when they game data relating to our toon was last added to the database. Anything that was still in active memory, but not yet written to the db, is gone.
Once in a while, they do have to restore to a backup, and the data is then "warped" to the date and time of the last good backup. I do not know if the db Realm is using is capable of transaction log backups or not, but even if it is, you would have the game down for many hours or possibly days every time there is a db problem instead of a short time, and think of the screaming by players then.
How to protect your stuff!
The risk of losing items, levels etc, can be reduced fairly easily. All you have to do is force the Realm program to write your toon and house information to the database. This will protect you from most of the "mini-warps" that happen when the game crashes and the database is not affected.
The one sure way to force your data to be saved to the database is to EXIT the game completely and sign back in. When you exit the game, the data for the toon you are currently playing incuding tooon stats (exp) inventory and all your house/ chest information is saved to the database.
This ONLY saves the data of the toon you have logged in, so if you are moving stuff between your toons and houses, you need to then log in each of the other toons involved and re-exit the game. You do not have to sign the toon in a second time, it is the exiting that saves the info to the db.
Most of the "mini-warp" item losses are caused when someone goes to an alts house, takes items or puts items there, and then the game crashes. The state of your active toon will get transferred to the db more often while you are playing, but the toon/ house info for the toon you are not playing may be in active memory until the next full backup, so is at more risk.There is also a risk that the "alt" house data is saved, but the active toon data has not been saved before the game crashes.
The game DOES save information to the database at other times, but those are controlled in the program and we cannot as easily force a save without exiting.
The other main thing to prevent losses is to NOT trade or transfer items during the morning backup time. Becasue the game is still live during the backup, it does not save an instant copy of the game, but saves a bit at a time so as to not prevent you from playing during backup. Years ago they actually shut the game down for a period of time each day to back it up - less risk to your items, but annoying to those who play at the time of the backup.
One more thing, the game is more at risk of crashes or issues if it has already crashed, and/or if it has just been updated. To minimize your risk, avoid big deals or moving stuff around for a while after an update, and especuially for a while after the game crashes.
<EDIT> One more thing, when your just out hunting, geting exp. etc., exit and re-enter the game once in a while so your exp and misc. treasure also get saved. The longer you are in game, the bigger risk of losing more exp or treasure.
********************************************** Summary to protect your items:
Any time you move stuff between toons or houses, find something really good while hunting, or make a big trade, immediatly exit the game, log in any other toons whose houses or items are involved, exit the game again, then log back in with the toon you are playing.
Do not move stuff between toons or houses and do not do any big trades while the morning backup is going on. This is ( I think) around 5 AM Eastern time US.
Do not move stuff between toons or houses, or do big trades, whenever the game is unstable. If it has crashed, there is always a risk that whatever has caused it will happen again. If there has been an update, there is always a chance of a bug that has not been found. The longer the game has been up, the less risk.
_________________________
Burke, out...
|
|
Top
|
|
|
|
|
|
0 registered (),
0
Guests and
2
Spiders online. |
|
Key:
Admin,
Global Mod,
Mod
|
|
61 Members
40 Forums
2893 Topics
3121 Posts
Max Online: 90 @ 07/12/07 10:46 AM
|
|
|