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

  • SEARCH
  • Home
  • 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 8721575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:14:38+00:00 2026-06-13T07:14:38+00:00

My Flask application is currently uses PostgreSQL to store all authentication information (users, tokens)

  • 0

My Flask application is currently uses PostgreSQL to store all authentication information (users, tokens) and interact with it. For other logic I need to use MongoDB. I like to use one technologies of one type instead of multiple to reduce complexity of an application (for example, only Redis instead of Redis + memcached).

So for now I’m thinking about using MongoDB only, using it as backend for authentication process.

Current workflow is following: PostgreSQL stores two tables: User and Token. When I sign up user, I open transaction, store his data (username, login, password) in User table, then insert activation token to Token table, then send activation letter, then close transaction. So, problem occurred in storing User, Token or later in code, when I’ll try to send email, transaction will be rolled back. It prevents cases when user created, but token not, so account can’t be activated.

As I know, transactions is not feature of MongoDB. So, if I will have two documents, User and Token, I will not be able to rollback creating of first if second can’t be created.

My questions are:

  1. How would you implement described behavior on MongoDB?
  2. Is it good idea to use only MongoDB for all stuff instead of PostgreSQL for authentication and MongoDB for documents?
  • 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-06-13T07:14:39+00:00Added an answer on June 13, 2026 at 7:14 am

    Yes, you do have to implement the signup logic yourself in this case. For example if you store the following document:

    user : {
        name : 'Alex Black'
        email : 'alex@example.com'
        token : {
            value : 'some_random_token'     # subject for indexing
            expires : '00.00.00.18.11.2012' # use MongoDB date here
        }
    }
    

    Then e.g. a cron script should remove all the expired users. But a trick would be in using the NoSQL features of Mongo!

    Just create two separate collections: Users and e.g. UnregisteredUsers. Store the user information to UnregisteredUsers and only when registration is confirmed transfer the user document from UnregisteredUsers to Users.

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

Sidebar

Related Questions

Currently I'm allowed users to add application/x-shockwave-flash objects to their profiles in my website.
Currently I have a flash based application (game) which I need to put on
Currently I am working on getting system information via a Silverlight Embedded Application tied
I have a Flex/Java web application that uses Maven as a build tool. Currently,
My application uses a combination of Flask, Flask-SQLAlchemy, Flask-WTF and Jinja2. In its current
My flask application currently consists of a single test.py file with multiple routes and
I'm starting new Google App Engine application and currently considering two frameworks: Flask and
I have a web application that currently uses Flash. That application allows the user
My Flash (AS3/AIR) application is currently using a slightly unusual architecture (for a Flash
Currently, I'm trying to develop a rich internet application using Flash Builder 4 Beta

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.