Giter Site home page Giter Site logo

recache's People

Contributors

bakape avatar

Stargazers

 avatar  avatar

Watchers

 avatar

recache's Issues

Benchmark against a classic Redis cache

  • time.Sleep() for 500 ms on data generation to simulate DB queries
  • 3 part document
    • Stored whole in Redis
    • Broken down in recache
  • Key retrieval function for Redis versioning with time.Sleep() for 50 ms
  • Evict/return new key each 5 seconds

Populate recursive components asynchronously

  • If recordReference is not in the cache on query, schedule it to be fetched in a separate goroutine to not block retrieving any subsequent components.
  • Add Await() error method to component interface, that blocks until a component is retrieved.
    • Block only for async recordReference retrieval.

Having a separate Await() method instead of returning errors on read allows for error to be propagated before the first write to destination.

Use a forward list for record components

Most records should have 1-3 components and thus not using arrays can prevent extra indirection. At the end of the struct can be an extension slice for records with more components.

Horizontal scaling

  • Need to asserts server version through some means and not communicate with instances of same version. Considering the variations possible both in the system and externally, a cache should have a manually set name and version. If not set, no horizontal scaling is performed.
  • Consider, if static or dynamic sharding by hash is better.
  • Consider, if this useful at all, considering the extra I/O costs. Opting for only vertical scaling might be more optimal.
  • Consider how to handle a client requesting a key belonging to a foreign shard.

Rewrite in Rust

  • Rewrite using Rust stdlib
  • Leave thread/async management to the caller. The lib only acts as persistent linker layer.
  • Provide C bindings and header file
    • Pass errors as void* to allow casting between language-idiomatic error types
  • Rust implementation should take any generic parameter implementing Hash as a Frontend Key
  • C bindings should only allow keys fixed format. Bindings should (en-)/(de-)code keys to/from this format .
  struct RecacheBufferKey 
  {
    size_t size;
    uint8_t *data;
  };
  • Write Go bindings
    • Go bindings should use zero copy unsafe casts for buffers
    • Marshal and unmarshal keys using encoding/gob
      • Reuse the encoder on the frontend
  • Compile optimized binaries for all supported architectures and distribute them with the project

Transform method on RecordWriter

To establish a parenthood relationship between records, but not include it in the output. That is, the child transforms the parent and outputs the result.

Server mode

Read config.json file on boot to configure the caches and frontends without requiring any Go programming.

Something like

[
  {
    "limits": {
     "memory": "100M",
     "last_used": "1m30s" 
    },
    "frontends": [
      "endpoint": {
        "url":  "/:company/:brand", // Join with delimiter and use that as a key
        "headers": {
           "Content-Type": "application/html"
         } 
      }
      "source": {
         "url": "http://localhost:8000/my-data-source",
         "headers": {
           "Authorization": "Bearer d4ea54de3a54d1d5ea1de"
         }
      }
    ]
  }
]
  • Add sample to docs
  • Add jsonc file with usage description to docs
  • Add a simpler mode, where the server just acts as 1:1 proxy from one path to another

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.