Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3984220
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:44:37+00:00 2026-05-20T05:44:37+00:00

I am developing a multiplayer gaming server that uses Django for the webserver (HTML

  • 0

I am developing a multiplayer gaming server that uses Django for the webserver (HTML frontend, user authentication, games available, leaderboard, etc.) and Twisted to handle connections between the players and the games and to interface with the games themselves. The gameserver, the webserver, and the database may run on different machines.

What is the “best” way to architect the shared database, in a manner that supports changes to the database schema going forward. Should I try incorporating Django’s ORM in the Twisted framework and used deferreds to make it non-blocking? Should I be stuck creating and maintaining two separate databases schemas / interfaces, one in Django’s model and the other using twisted.enterprise.row?

Similarly, with user authentication, should I utilize twisted’s user authentication functionality, or try to include Django modules into the gameserver to handle user authentication on the game side?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T05:44:37+00:00Added an answer on May 20, 2026 at 5:44 am

    First of all I’d identify why you need both Django and Twisted. Assuming you are comfortable with Twisted using twisted.web and auth will easily be sufficient and you’ll be able to reuse your database layer for both the frontend and backend apps.

    Alternatively you could look at it the other way, what is Twisted doing better as a game server? Are you hoping to support more players (more simultaneous connections) or something else? Consider that if you must use threaded within twisted to do blocking database access that you are most likely not going to be able to efficently/reliably support hundreds of simultaneous threads. Remember python has a Global Interpreter Lock so threads are not necessarily the best way to scale.

    You should also consider why you are looking to use a SQL Database and an ORM. Does your game have data that is really best suited to being stored in an relational database? Perhaps it’s worth examining something like MongoDB or another key-value or object database for storing game state. Many of these NoSQL stores have both blocking drivers for use in Django and non-blocking drivers for use in Twisted (txmongo for example).

    That said, if you’re dead set on using both Django and Twisted there are a few techniques for embedding blocking DB access into a non-blocking Twisted server.

    1. adbapi (uses twisted thread pool)
    2. Direct use of the twisted thread pool using reactor.deferToThread
    3. The Storm ORM has a branch providing Twisted support (it handles deferToThread calls internally)
    4. SAsync is a library that tries to make SQLAlchemy work in an Async way
    5. Have twisted interact via RPC with a process that manages the blocking DB

    So you should be able to manage the Django ORM objects yourself by importing them in twisted and being very careful making calls to reactor.deferToThread. There are many possible issues when working with these objects within twisted in that some ORM objects can issue SQL when accessing/setting a property, etc.

    I realize this isn’t necessarily the answer you were expecting but perhaps more detail about what you’re hoping to accomplish and why you are choosing these specific technologies will allow folks to get you better answers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a multiplayer game I'm developing, we have a few values that are floating
I'm developing open source cross-platform platform for non-realtime multiplayer chat/game system. Like card games,
I'm developing a multiplayer game that is going to work by transmitting data over
we are developing a database backend for a multiplayer game. The server is written
we are developing a database backend for a multiplayer game. The server is written
Developing server side code i finally got my eyes X-crossed trying to write -
When developing a new web based application which version of html should you aim
When developing an application that sends out notification email messages, what are the best
I'm thinking about developing online multiplayer social game. The shared state of the world
I'm developing a multiplayer strategy wargame based on a hexagonal grid, and trying to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.