Can you give some tips on setting up my database?

I am working on MUD (Multi User Dungeon) in Python, and now I just turn around to the point that I need to add some rooms, enemies, items, etc. I could write it all hard, but it seems like this is more of a job for the database.

However, I had never done any database work before, so I was wondering if you have any tuning tips?

  • In what format should I store data?
    • I was thinking about storing the Dictionary object in the database for each object. That way, I could just add new attributes to the database on the fly without changing the database columns. Does that sound reasonable?
  • Do I have to store all the information in one database, but in different tables or different entities (enemies and rooms) in different databases.

  • I know this will be a can of worms, but what are the suggestions for a good database? Is MySQL a good choice?

+3
source share
5 answers

1) There was almost never a reason to have data for the same application in different databases. If you are not a Fortune500-sized company (okay, I exaggerate).

2) Store the information in different tables.

As an example:

  • T1: Rooms

  • T2: General properties of the room (applicable to each room), with number on ** number *

  • T3: ( ) - thos

  • T4:

    T2 T3 , " ", // ( Object/attribute/value IIRC, )

3) , - , . "Get_room", - SQL ANSI SQL, .

SQLite. , SQL ( ). , FireFox IIRC ( FireFox 3 - , , .. - SQLite).

MySQL Postgres ( , ). IIRC - Sybase db, , .

+3
  • -. , , . , , .
  • .
  • , PostgreSQL. MySQL , , PostgreSQL, , . - , , SQLite - .
+3

(/) - , 100% .

+2

,

, " " " ". MUD , . , , . , Python sqlite, SQL.

. , . , . , . .

, "- ", . Python SQLObject, SQLAlchemy, Autumn. , . , , ORM .

. , " " . ?

, - , 99% . , , , . shelve .

, ( ) .

. . (, MySQL, SQL Server, SQLite ..).

, , ? MySQL?

sqlite, SQL. MySQL , PostGreSQL.

+1

. .

, , , , ..

, , . , ? ? ? ?

It seems pedantic, but you will get rid of many troubles at an early stage by finding out which database objects "belong" to other database objects.

0
source

Source: https://habr.com/ru/post/1719754/


All Articles