Skip to content
We3vision
← All articlesGame Development

Saving Progress in Online Games: Accounts and Databases

How online games store progress safely: accounts and login, a database for profiles and items, caching, transactions, backups and privacy.

Saving Progress in Online Games: Accounts and Databases

In an online game, progress does not live on the player's phone or PC. It lives on the game's servers, in a database. Money, items, levels and unlocked missions must survive crashes, new game versions and players who switch devices. That makes the backend, the part of the game that nobody sees, just as important as the 3D world.

Accounts and sign-in

A player account identifies who is who. Players sign in with an email and password, with a platform account or with a social login. The backend checks the sign-in and gives the game a short-lived token that proves who the player is. Passwords must never be stored as plain text: they are stored as salted hashes, and many games let a trusted login provider handle this.

What goes in the database

  • The player profile: name, level, settings
  • The inventory: items, vehicles, weapons, clothes
  • Progress: finished missions, unlocked areas, achievements
  • The economy: money, purchases and transaction history
  • Social data: friends, groups, messages

Both relational databases, such as PostgreSQL, and document databases, such as MongoDB, are used. Relational databases are strong when data must stay consistent, for example a purchase that must take money and give an item together. Document databases are flexible for profile data that changes shape often.

Transactions: never lose or duplicate an item

A trade between two players must either complete fully or not happen at all. Databases offer transactions for this. Without them, a crash in the middle can remove an item from one player and not give it to the other, or give it to both. The server makes all changes to valuable data, never the client (multiplayer architecture).

Speed: caches and saving rules

  • The game keeps the data of active players in memory and saves it at safe moments, for example after a mission, instead of every second
  • A cache such as Redis answers repeated reads quickly, for example leaderboards
  • Heavy jobs, such as ranking or reports, run in the background
  • Servers that run the world read the profile when a player joins and write it back when the player leaves

Backups, versions and privacy

  • Regular backups and a tested restore plan protect against failures and mistakes
  • A new game version must read old saves: data has a version number and migration steps
  • Laws such as GDPR and the privacy rules of other countries decide what you may store and how a player can ask for deletion
  • Logs of important actions help to investigate cheating and support requests

As the player base grows, the database must grow too (how game servers scale), and it must be protected (anti-cheat and security). See how online open-world games are made for the full picture.

Frequently asked questions

Where is player progress stored in an online game?

It is stored on the game's servers in a database, linked to the player's account, so that it survives device changes and crashes.

Which database is best for a game?

It depends on the data. Relational databases such as PostgreSQL are a good choice when data must stay consistent, such as purchases and trades. Document databases such as MongoDB are flexible for profile data. Many games use both.

How do games stop item duplication?

The server makes all changes to items, and trades and purchases run inside database transactions, so they either complete fully or not at all.

Let's talk

Want To Build Something?

Tell us about your project and the We3vision team will get back to you.

Step 1 of 4

What would you like to make?

Pick as many as you like.

Surat (Head Office)

We3vision House 1/936, Bhim Kachchhi Mohallo,

Nanpura Surat, Gujarat, India, 395001

info@we3vision.com

Germany

Zum Lahnberg 64, Marburg, 35037

germany@we3vision.com

+49 1516 2774145