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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:57:59+00:00 2026-05-11T00:57:59+00:00

It’s probably the tenth time I’m implementing something like this, and I’ve never been

  • 0

It’s probably the tenth time I’m implementing something like this, and I’ve never been 100% happy about solutions I came up with.

The reason using mysql table instead of a ‘proper’ messaging system is attractive is primarily because most application already use some relational database for other stuff (which tends to be mysql for most of the stuff I’ve been doing), while very few applications use a messaging system. Also – relational databases have very strong ACID properties, while messaging systems often don’t.

The first idea is to use:

 create table jobs(   id auto_increment not null primary key,   message text not null,   process_id varbinary(255) null default null,   key jobs_key(process_id)  ); 

And then enqueue looks like this:

 insert into jobs(message) values('blah blah'); 

And dequeue looks like this:

 begin; select * from jobs where process_id is null order by id asc limit 1; update jobs set process_id = ? where id = ?; -- whatever i just got commit; -- return (id, message) to application, cleanup after done 

Table and enqueue look nice, but dequeue kinda bothers me. How likely is it to rollback? Or to get blocked? What keys I should use to make it O(1)-ish?

Or is there any better solution that what I’m doing?

  • 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. 2026-05-11T00:57:59+00:00Added an answer on May 11, 2026 at 12:57 am

    I’ve built a few message queuing systems and I’m not certain what type of message you’re referring to, but in the case of the dequeuing (is that a word?) I’ve done the same thing you’ve done. Your method looks simple, clean and solid. Not that my work is the best, but it’s proven very effective for large-monitoring for many sites. (error logging, mass email marketing campaigns, social networking notices)

    My vote: no worries!

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

Sidebar

Ask A Question

Stats

  • Questions 167k
  • Answers 167k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The TCP_TABLE_CLASS is an enum typedef enum { TCP_TABLE_BASIC_LISTENER, TCP_TABLE_BASIC_CONNECTIONS,… May 12, 2026 at 1:33 pm
  • Editorial Team
    Editorial Team added an answer It seems that the problem was related to removing a… May 12, 2026 at 1:33 pm
  • Editorial Team
    Editorial Team added an answer You might want to try https://www.appfigures.com/. Checking for reviews and… May 12, 2026 at 1:33 pm

Related Questions

I have a JSP page retrieving data and when single or double quotes are
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
this is what i have right now Drawing an RSS feed into the php,
I am currently running into a problem where an element is coming back from
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.