Giter Club home page Giter Club logo

willow2's Introduction

Willow

画像标签相关。
探讨如何能轻量化低成本的处理大量消费者标签的快速查询问题。

思路

两种思路:(本项目仅验证第二种思路,第一种思路见Willow)

  • 消费者标签表按照通用的关系表模式进行设计,它应该表现为一个稀疏矩阵,借助 go-memdb 的特性,在内存中 存储消费者标签数据,其每个标签列均做成索引,允许索引列值缺失,以此减少存储空间,提高检索效率。
  • 将消费者标签展开,每个标签只有 两个状态,只占1个bit的存储空间。按顺序将标签排列起来,每 每个消费者的所有标签的存储则变为了 N 个 bit 的数组,N 等于标签个数。这样其占据的空间会非常小,在检索时, 将检索条件同样按照标签排序组成一个 N 位的 bit 数组作为检索数组,将检索数组与目标数组执行按位与操作即可。 此种方法在查询标签较多时应该可以有效保证检索速度。

逻辑架构

待决问题

由于 go 语言无法直接操作 bit,所以本思路必须变通。思路已有,没时间写,回头再说。

License

Copyright © 2021 - 2025 rjguanwen
Released under MIT license, see LICENSE for details.

willow2's People

Contributors

rjguanwen avatar

Watchers

James Cloos 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.