Giter Site home page Giter Site logo

json-searcher's Introduction

Json Searcher

Descriptions:

A Json searcher support fast search on defined entities

OS: *Debian (Docker)

Get Started

Systems Diagram

Design Philosophy

Appendix

Get Started

How to: run the app in an env with jdk8 and sbt setup

Run Test:
sbt clean test
Start the console app:
sbt clean run

How to: run the app without jdk and sbt

Please be aware, the docker image will be built from scratch, which means the building time for the first run would be super long....

after the first run, two external volume would be created to cache all the loaded dependencies to make the next run much faster;

Run Test:
./auto/test
Start the console app:
./auto/run

Systems Diagram

 
 ________________________________                  ______________________________________________________
|    Console                    |                  |            Json-Searcher-Core                       |
|                               |                  |        __________________________________           |               
|  atStart                      |        |---------|-----> |- materialise denormolised-data   |          |
|  atInstruction                |        |         |       |- preload indices                 |          |
|  atSearchableFields           |        |         |       |__________________________________|          |                         
|  atStartSearch   -------------|--------|         |                                   |                 |
|  atEnterSearchTerm     --->|  |               |--|-->A In memory SearchStore <-------|                 |
|  atsEnterSearchValue   |<---| |               |  |                |                                    |
|  atOperateSearch   <---|      |               |  |                |                                    |
|               |               |               |  |                |                                    |
|               |_____________SearchTerm________|  |                |                                    |
|                               |                  |                |                                    |   
|     stdout    <---------------|----SearchResults-|----------------|                                    |
|_______________________________|                  |_____________________________________________________|

Design Philosophy

Core Principles:

  • Searhable Data should be denormolised for fast search
  • Data should be indexed by the available search key
  • Searchable Data should be materialised into memory before SearchOperation
  • Console should have finite states and each state should know its previous restatable state
  • Exceptions should not break the user experiences and should have instructive notifications

Disadvantages and optimizations:

Out of Memonry when large volume of data exceeding single machine capacity:

Although diskIO by streaming in-memory-denormolised data into multiple partitions in disk by hash key for a given search key could guarantee the memory would not be explored given a big enough disk volume;

This appraoch would slow down the search dramactically even with HDFS support;

The ideal way to optimise this large volume data scenario would be applying distributed computing in a cluster with mutiple machines; each instance could be working on a partition of searchkey and later on assemble the result to serve back to the searcher; It is a well-known map-reduce application senario;

Appendix

Domain Analysis:

  1. Organisation:

    All Fields are required

  2. Tickets:

    Optional Fields: [type, description, assignee_id, organization_id, due_at]

  3. User:

    Optional Fields: [alias, verified, locale, timezone, email, phone, organization_id]

Denormolised-View for search-results-entity:

  • on user granularity:
    UserSearchResult {
        user: User,
        org: Option[Organisation],
        assigned_tickets: List[Ticket],
        submitted_tickets: List[Ticket]   
    }
    
  • on ticket granularity:
    TicketSearchResult {
        ticket: Ticket,
        org: Option[Organisation],
        assignee: Option[user],
        submitter: Option[user] 
    }
    
  • on organisation granularity:
    OrganisationSearchResult {
        org: Organisation,
        users: Array[User],
        tickets: Array[Ticket]
    }
    

json-searcher's People

Contributors

frankiechan 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.