Giter Site home page Giter Site logo

tatakosan's Introduction

Tatakosan

這是一個實驗計畫,主要就是能夠快速使用 Key , Value 存取資料,主要資料庫我是使用 Azure Storage Table ,因為他很便宜(該死的客家人本性)

除了單純寫入 Azure Storage Table 之外,我還有做記憶體快取,讓存取速度可以正常,這裡我是 base on .netcore 3.1

已經派上用場一些時間了想說就分享一下

這邊簡單測試過大量寫入下的穩定性,如果有任何問題就在跟我一起交流交流吧。

順帶一提,這不支持 scale out 的狀況,如果有兩台機器要小心快取在記憶體中的資料不同步問題。

Dependency :

Microsoft.Azure.Cosmos.Table

Newtonsoft.Json

No2vers.AzureTable


How To Start?

in Startup.cs

        /// <summary>
        /// Azure Blob Table Connection String.
        /// </summary>
        public static readonly string _BlobConnectionString = "DefaultEndpointsProtocol=https;AccountName=...";


        /// <summary>
        /// /api/Op/ClearPool?token=token  的token
        /// </summary>
        public readonly static string ClearToken = "token";


        public readonly static string HashToken = "TATAKOSAN";

        /// <summary>
        /// 五分鐘請檢查一下快取有沒有過期
        /// </summary>
        private readonly static int RecycleMinutes = 5;

        /// <summary>
        ///  如果 60 秒,都沒有人請求,在進行回收
        /// </summary>
        private readonly static int HowManySecondsNoDataRequest = 60;

        /// <summary>
        /// 如果多少分鐘沒有人存取就回收
        /// default : 4hr * 60=2400;
        /// </summary>
        private readonly static int KeepMinutesInMemory = 2400;
       

Simple Swagger Document:

https://tatakosandoc.azurewebsites.net/tversion2/

tatakosan's People

Contributors

donma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.