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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:25:02+00:00 2026-06-16T01:25:02+00:00

http://martinfowler.com/articles/dblogic.html Using the terminology of the above article, the Transaction Script pattern of coding

  • 0

http://martinfowler.com/articles/dblogic.html

Using the terminology of the above article, the Transaction Script pattern of coding is clearly an antipattern when dealing with SQL databases.

Is the same true of NoSQL databases (like MongoDB) also? Assume that the columns – which the nosql query will be using -are all appropriately indexed.

The reason I ask this question is: Query execution in MongoDB returns a cursor, which can be iterated upon. What I don’t know is, whether or not there is a performance penalty associated with it.

  • 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-16T01:25:03+00:00Added an answer on June 16, 2026 at 1:25 am

    The article describes a “Transaction Script” as

    [a] procedure reads in all the data it might need and then does the selection and manipulation in-memory to figure out which [database entries] are needed.

    Every NoSQL database is different, so you can not generalize anything for “NoSQL”. But in almost every database system it’s a good idea to do as much on the database as possible.

    1. As long as you are using the query syntax of your database, it can at least in theory use indices to speed up certain operations, but as soon as the result set is returned, the index information is lost, which makes these operations more expensive.
    2. When you get a huge result set from the database and then filter it on the application layer, you have to pass all that data over the network. Depending on how well your network infrastructure works, this can become a performance bottleneck (assuming that your database is on a different physical server – which it usually should be in a production environment). Transfering huge datasets also screws with any buffering systems of the database or your database driver.

    When you are asking about MongoDB specifically: MongoDB databases aren’t designed to be as “smart” as SQL databases. The design assumes that many problems which SQL databases solve themselves, are solved on the application layer instead (constraints, cascading deletes, joins, transactions…). The query syntax also isn’t as powerful as all the features which accumulated in 40 years of SQL development. That means that you often don’t get around doing filtering on the application layer. But when a problem can be solved with the query syntax, you should generally try to do so.

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

Sidebar

Related Questions

I'm trying to work through an article ( http://martinfowler.com/articles/mocksArentStubs.html ) on mocking with pseudocode
I've read xUnit Test Patterns. http://martinfowler.com/books.html There is 'Churchillian knock-off' expression in Martin Fowler's
http://mindfulintegrations.com/signiacapital/index.html It works fine in FF3 and IE8 using SwfObject2 and wmode=transparent, but for
http://jsbin.com/oqotew/edit#html,live If you visit the link above when you have a wide browser window,
http://www.dorsetdesigns.co.uk/contact.html try the form it wont send a email to me. i am using
http://marianoagency.com/intranet/trial.html Everything works fine until I start typing any of the sample tags (like
http://tinyns.com/wtf.php I'm using jQuery Typist to display server benchmarks results. I have the results
http://www.microsoft.com/windowsxp/using/accessibility/characterrepeatrate.mspx - There's an option in Windows for setting repeat delay. It means the
http://www.docjar.com/html/api/org/apache/catalina/realm/JDBCRealm.java.html To use this JDBCRealm we need two tables, user and user_role. user table
http://thedailywtf.com/Articles/The-Hot-Room.aspx You see how at the bottom there're links to the next and previous

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.