Giter Site home page Giter Site logo

txstudio / eshoppanicbuyingsimulatorusestoreprocedure Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 2.0 538 KB

模擬電子商務網站搶購商品的範例程式碼 - 使用預存程序

Home Page: https://blog.txstudio.tw/2018/11/eshop-panic-buying-use-store-procedure-intro.html

PLSQL 24.29% PLpgSQL 18.23% C# 57.49%
t-sql netcore stored-procedures

eshoppanicbuyingsimulatorusestoreprocedure's Introduction

電子商務網站搶購模擬 - 使用預存程序

這是一個模擬電子商務網站遇到在大量商品訂購需求中是否會有商品超賣的情況

本專案使用資料庫與程式語言如下

本範例程式碼有一個對應的 Entity Framework Core 版本,並使用 Code First 建立資料庫 txstudio/eShopPanicBuyingSimulatorUseEFCore

資料庫

範例資料庫使用 Microsoft SQL Server in Docker 的 Image 建立,可以使用下列指令碼啟用 Container

docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=Pa$$w0rd' -p 1433:1433 -d

.NET Core 應用程式

使用 ADO.NET 呼叫資料庫物件模擬大量使用者訂購行為

目錄說明

資料庫與應用程式更詳細說明請參考對應資料夾內的說明 (readme.md) 檔案

資料夾 對應內容
db Transact-SQL 指令檔
netcoreapp/eShop.Loader .NET Core 主控台應用程式

後紀

原本設計為 procedure-default.sql ,但進行負載測試後會出現有商品超賣的情況

感謝楊志強老師給予指點將重點物件設定修改為 procedure-correct.sql 的方式在相同測試條件下商品沒有出現超賣的情形

eshoppanicbuyingsimulatorusestoreprocedure's People

Contributors

txstudio avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.