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 669955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:12:32+00:00 2026-05-14T00:12:32+00:00

I am kinda new to database designing so i ask for some advices or

  • 0

I am kinda new to database designing so i ask for some advices or some kind of a good pattern.

The situation is that, there is one database, few tables and many users. How should i design the database, or / and which types of queries should i use, to make it work, if users can interact with the database simultaneously? I mean, they have access to and can change the same set of data.

I was thinking about transactions, but I am not sure, if that is the right / good / the only solution.

UPDATE:

By many i mean hundreds, maybe thousands at all. Clients will be connecting to MySQL through WWW page in PHP. They will use operations such: insert, update, delete and select, sometimes join. It’s a small database for 5-20 clients and one-two admins. Clients will be updating and selecting info. I am thinking about transactions with storing some info in $_SESSION.

  • 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-14T00:12:33+00:00Added an answer on May 14, 2026 at 12:12 am

    a simple approach that can be very effective is the row versioning.

    • add a version int field to the main table,
    • when insert, set it to 0
    • when update, increment it by one; in the where it should be the version field

    EXAMPLE:

    CREATE TABLE myTable (
    id INT NOT NULL,
    name VARCHAR(50) NOT NULL,
    vs INT NOT NULL,
    )
    
    INSERT INTO myTable VALUES (1, 'Sebastian', 0)
    
    -- first user reads, vs = 0
    SELECT * FROM myTable WHERE id = 1
    
    -- second user reads, vs = 0
    SELECT * FROM myTable WHERE id = 1
    
    -- first user writes, vs = 1
    UPDATE myTable SET name = 'Juan Sebastian', vs = vs + 1 WHERE id = 1 AND vs = 0
    (1 row affected) 
    
    -- second user writes, no rows affected, because vs is different, show error to the user or do your logic
    UPDATE myTable SET name = 'Julian', vs = vs + 1 WHERE id = 1 AND vs = 0
    (0 rows affected) 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm kinda new to running Perl on windows, and I'm having some problems with
I am kinda new in perl, i wanted to know if there is a
I am kinda new to this Regex thing. When analyzing some code I frequently
I'm new to database design and I considering implementing something that will be time
I am new to designing my own database. My project is orders/products/inventory type data,
I have a stored procedure that inserts a few columns into a database, IP
I'm new to databases and web servers and that kind of thing. So I
Im kinda new to SQL Server and am using the 2005 version. What I
I'm kinda new in asking @Stackoverflow, however it's been the closest thing I have
I'm kinda new to android development, but i'm trying to make a xml parser.

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.