locked
Web Applicaiton Product Promotion Performance Issue RRS feed

  • Question

  • Dear All

    Thank you for your attention.

    I am building a web application using C# which contains a large amount of data for product promotion (more than 10000 records).

    I would like to let user check the discounted price after promotion calculation with fast response.

    What structure (search tree?) or algorithm or technique could be used?

    It would be best for something using C#, if C# could not do this, any suggestion on other language is also welcome

    Thanks.

    Best Regards

    mintssoul


    Best Regards
    mintssoul

    • Moved by Caillen Friday, May 29, 2015 5:29 AM
    Thursday, May 28, 2015 4:07 AM

Answers

  • I am building a web application using C# which contains a large amount of data for product promotion (more than 10000 records).

    Then where you should be posting is to the ASP.NET forum, a Web forum.

    http://forums.asp.net/

    • Proposed as answer by Caillen Friday, May 29, 2015 5:29 AM
    • Marked as answer by mintssoul Monday, June 1, 2015 2:18 AM
    Thursday, May 28, 2015 5:20 PM

All replies

  • "I would like to let user check the discounted price after promotion calculation with fast response."

    You have provided way too little information for someone to be able to provide an answer. What is the user supposed to check about the price? Where are those "records" are stored? I'd assume a database but then what that has to do with data structures and algorithms?

    Thursday, May 28, 2015 5:55 AM
  • Dear Mike

    Thank you for your reply.

    Sorry for the little information. I am not familiar with system design so would like to find any idea here.

    At first, I would like to explain why I use  the wordings structures and algorithms.

    I have heard something about expression tree or b-tree that can help, but not yet researched on these topics.

    And I can think of loading those promotions into memory may increase the performance.

    However, I really not sure how to implement these things into my C# web application.

    And I am not sure the name of these things so I could just use the wordings "structures and algorithms"

    In fact I just means any techniques in any areas that can help.

    If this lead to any misunderstanding, I am sorry about that.


    Let me explain more details here:

    Promotions

    There are more than 10000 promotions such as "buy A and B then 20% discount" and "buy any products in gp A free 1 B", etc 

    Since there is a project to be done, there is no limit on where to store the promotion.

    I would like to get any idea for this solution that can be normal database (MSSql) or any other storage (no-sql, csv, etc).

    System Flow

    User come to product page, he can search or browse products and then add to cart.

    The promotions are use in two ways

    A) In the cart, if both A and B exist, a discount 20% will show to user (Assume promotion 'buy A and B then 20% discount')

    the main issue is how to  i)  store the promotion data ii) retrieve the matched promotion  to increase the performance of viewing he cart page  as there are many promotions.

    it is expected that if the data storage or retrieve algorithm are not well designed, the performance will be very slow.
    And I would like to prevent this at this design stage.

    B) Similarly , on the right hand side of the product page, there will be a discount corner for showing one of the related promotions.

    For example, when user viewing product A,  then the discount corner may show the promotion "buy A and B will get 20% discount" to attract user.

    My Question

    My question is using what techniques (may be database, data storage structure, retrieve algorithm) could be used to build a fast response promotion discount web application.

    If still not clear please let me know, and I will explain more

    Thanks for your patient and help.

    Best Regards

    mintssoul


    Best Regards
    mintssoul

    Thursday, May 28, 2015 6:44 AM
  • The promotion and products are many-to-many relationship, one promotion can contain multiple products, and one product can belong to multiple promotions.

    Table Structure

    Promotion table

    --------------------------------------

    |   ID    |    discount_ratio  | ...

    Product table

    --------------------------------------

    |    ID    |    name   |  price  |    ....

    Join Table

    -------------------------------------------------

    |    ID   |  promotion_id  |   product_id   |

    Retrieving Data

    For retrieving data, you can use memcache to cache your database query


    • Edited by gbstack Thursday, May 28, 2015 2:43 PM
    Thursday, May 28, 2015 2:43 PM
  • I am building a web application using C# which contains a large amount of data for product promotion (more than 10000 records).

    Then where you should be posting is to the ASP.NET forum, a Web forum.

    http://forums.asp.net/

    • Proposed as answer by Caillen Friday, May 29, 2015 5:29 AM
    • Marked as answer by mintssoul Monday, June 1, 2015 2:18 AM
    Thursday, May 28, 2015 5:20 PM