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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:36:36+00:00 2026-05-25T17:36:36+00:00

Embedded vs link I’m looking for the fastest way to search a Newsletter document

  • 0

Embedded vs link

I’m looking for the fastest way to search a Newsletter document for a connected Email. So far I have used MongoMapper with one document for Newsletter and another for Email. This is getting really slow with +100k Emails.

I was thinking maybe its faster to embed the emails in an array inside Newsletter
since I’m really only interested in the email (‘someemail@email.com’)
and not any logic around it.

1) Is it possible at all to embed as much as 100k-500k emails in one document?
2) Is Mongoid better/faster for this?

I’m adding the email if it is not already in the collection by asking

email = newsletter.emails.first(:email => 'someemail@email.com')
unless email
    email = Email.new(:email => 'someemail@email.com', :newsletter_id => self.id)
    email.save
end

And I think this is where it all starts to hurt.

Here is how they are connected
Class Newsletter
include MongoMapper::Document
many :emails
…
end

Class Email
   include MongoMapper::Document
   key :email, String
   key :newsletter_id, ObjectId
   belongs_to :newsletter
end

would love for any help on this 🙂

  • 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-25T17:36:37+00:00Added an answer on May 25, 2026 at 5:36 pm

    There is a maximum document size of 16mb currently for MongoDB, MongoMapper or Mongoid will make no difference to this.

    see http://www.mongodb.org/display/DOCS/Documents

    Embedded documents should be considerably quicker though, if you can fit all the emails within the limit could be a squeeze.

    If storing the whole email is to much, why not just store either an array or just embedded the emails address withing the newsletter with a reference to the full email.

    You can then get the speed advantage you want, and keep the emails accessible outside of the newsletter.

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

Sidebar

Related Questions

I have a link in a pdf-document (PDF1), which is embedded in a browser
Is it possible to use a flash document embedded in HTML as a link?
I have an embedded database in windows forms app. Is it possible to browse
I have embedded a Google Map in my website. I want to change its
Possible Duplicate: Embedded a *.exe into a dll I have a C# project -
I have an embedded device where i need to put my /var and /tmp
This link seems to suggest that it just works: (pretty far on the bottom
i have a youtube embedded channel from a certain company, and below i have
I have a Canvas Facebook app embedded via an iframe. I would like to
I have a music player swf embedded on an html page. Is there any

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.