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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:58:34+00:00 2026-05-17T21:58:34+00:00

Back-Story On a current project, I am using MySQL and SQLite in combination with

  • 0

Back-Story

On a current project, I am using MySQL and SQLite in combination with each other. I’m currently giving each user their own SQLite database to get around my provider’s 1GB MySQL DB limit. It’s worked out alright and the performance is good, but I know for a fact that continual maintenance of these flat-file databases will be a nightmare in the future.

SQLite is surprisingly powerful, and supports some pretty complex SQL queries. However, I’m looking at MongoDB to hop on board with a little NoSQL for my user’s bulk data. Each user could generate 60,000 rows or more. With a continually growing number of users, I get to worry about performance in the future.

–

Complexity

My worry with MongoDB and the other NoSQL databases is that they seem more limited in what kind of query operations they support. It’s no big deal if you just need straightforward, simple bulk queries, however I’ve got to do some more complex joining and filtering (unions, case-sensitivity, groupings, the occasional join, etc…).

My example query is attempting to select a list of tracks by artist. The main problem is that these artist names may not match. For example some people tag as “A Day to Remember” and some people tag as “A Day To Remember”. With a case sensitive query, this causes multiple records that are “different” but really the same thing to come back. Typically I trim and LOWER() the fields to properly group them together.

–

Performance

I created two fresh, new databases on my local machine. One for MongoDB, and one for MySQL. I’m talking to them with PHP since that’s what my end result will have to use. Each database only has about 9,000 records in it, so it’s not terribly large at this point.

I ran a few tests on my machine and came up with disappointing results for MongoDB. Let’s consider these three queries…

#1 – MongoDB: ~14ms, incorrect results

$query = array('artist' => 'A Day to Remember');
$cursor = $collection->find($query);
foreach ($cursor as $row) {
    echo $row['artist'] . ' - ' . $row['album'] . ' - #'. $row['track'] . ' ' . $row['title'] . "\r\n";
}

#2 – MongoDB: ~170ms, correct results

$query = array('$where' => "this.artist.toLowerCase() == 'a day to remember'");
$cursor = $collection->find($query);
foreach ($cursor as $row) {
    echo $row['artist'] . ' - ' . $row['album'] . ' - #'. $row['track'] . ' ' . $row['title'] . "\r\n";
}

#3 – MySQL: ~18ms, correct results

$sql = "select artist, album, track, title from radio_files where lower(artist) = 'a day to remember'";
$stmt = $mysqldb->prepare($sql);
$stmt->execute();
while($row = $stmt->fetch(PDO::FETCH_ASSOC))
{
    echo $row['artist'] . ' - ' . $row['album'] . ' - #'. $row['track'] . ' ' . $row['title'] . "\r\n";
}

–

Discussion

Maybe I’m simply not querying correctly for #2, but just look at how the Javascript query engine kills it. There’s not even very many records for it to deal with here in total: just under 9,000 in all of the database.

My main question is this: what is going to be more reliable and performant in the end and still suit my needs? As my project’s userbase grows, I’m looking to leave my limited server and get something dedicated anyways. With my own MySQL installation I should be able to maintain my own large MyISAM tables with little relational data and proper indexing.

But with millions of records in the database, what happens to MySQL’s performance? Thoughts, comments, and general discussion about this are encouraged. Thanks!

  • 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-17T21:58:35+00:00Added an answer on May 17, 2026 at 9:58 pm

    Try with a regular expression :

    $regex = new MongoRegex('/^' . preg_quote('a day to remember'). '$/i');
    $query = array('artist' => $regex);
    $cursor = $collection->find($query);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

back story: I am designing a portfolio website for myself. on its home page,
The Back Story I have some decimal values which I am displaying as strings
One of my hobby applications uses a SQLite back end to store the application
Backstory: I'm using log4net to handle all logging for a project I'm working on.
One of the data structures in my current project requires that I store lists
Back in the old days, Help was not trivial but possible: generate some funky
Back in VB6, I wrote a few functions that would let me code without
Back in the days of Unix, you couldn't even close a software without reading
Considering the set up: Ms Access Application split into Front End and Back End
I have a view based project working with a UINavigationController. The RootViewController performs operations

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.