GithubHelp home page GithubHelp logo

buffer-sharing-in-multi-tenant-database-environment's Introduction

Buffer-Sharing-in-Multi-tenant-Database-Environment

ICPC 2023 Online Spring Challenge powered by Huawei
rank 118(regrettably didn't get 800 EUR)

1.Overview of task demand

The task ask competitors to accomplish the optimal scheduling algorithm to make page-evict smallest,the difficult is when the buffer sharing is full,which user should be chosen and which block shold be removed.For this problem,I accomlish one scheduling algorithm based on shadow price and LRU-hot cold zone.

2.Solution

2.1 the algorithm to choose user to be dispatch

When the buffer size is full,we should choose one previous block to remove for the new block,firstly we can designate one user to be dispatched.Through analysing the Scoring function, we can find that SLA is the important indicator that measure the user experience.So we can calculate the derivative of the score function,then we can choose the user has the smallest derivative,which is based on shadow price. In practice,we should firstly accomplish the SLAbase algorithm,then we can caluculate the SLA compared with the page-evict of SLAbase algorithm.

2.2 the algorithm to choose block

After we choose the user to dispatch,we should select which block of the user should be evicted from the buffer.In this step,due to the time limit,I accomplish the LRU base algorithm.For every user's block,we user the LRU to record the block status.When one block should be removed,we can remove one specific block based on LRU theory.As an improvement,I divide the LRU to two zone(cold zone and hot zone),which refer the mySql concept of cold and hot data.When one data is visited more than ome time,it enter the hot zone.When one block should be removed,we firstly select the block from the cold.And the size of cold and hot zone can be pointed in the initialization.

3.Improvement

In fact,for 2.2,you can accomplish other different algorithm like LFU,MFU,and choose the best algorithm for the given data is to simulate all of them, keep track of their hit rate, and switch to the best performing one.

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.