GithubHelp home page GithubHelp logo

redactedprofile / echo Goto Github PK

View Code? Open in Web Editor NEW
9.0 9.0 0.0 134 KB

In Memory Cache Datastore written with Deno

License: GNU General Public License v3.0

TypeScript 96.22% Dockerfile 2.61% Shell 0.63% Batchfile 0.54%
beta cache cache-storage deno typescript v8 v8-javascript-engine

echo's Introduction

echo's People

Contributors

redactedprofile avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

echo's Issues

Make deliverable Docker image

Using GitHub actions we should be able to compile a Docker image that executes the software with the native deno binary. The docker images can be stored on Github as well.

DockerHub may need to mirror, but it's not the most important part of this right now

Persist data to disk

Echo is an in-memory store first and foremost.

However, we can supply a configuration that allows a separate thread on a crontask to snapshot the data tables and store them as a compressed binary to disk in case of a server crash, and an admin wants to restore

Server crash when client disconnects

image

error: Uncaught ConnectionReset: An existing connection was forcibly closed by the remote host. (os error 10054)
    at unwrapResponse ($deno$/ops/dispatch_minimal.ts:63:11)
    at Object.sendAsyncMinimal ($deno$/ops/dispatch_minimal.ts:106:10)
    at async Object.read ($deno$/ops/io.ts:39:17)
    at async handle_connection (fi

Command: NUK

NUK is a command that flushes (or: "nukes") the entire database and resets all tables back to default.

  • Nukes the Database.

Command: GET

GET command is one that returns the value of a key as it is stored

  • Should return the string value verbatim as was stored in the key, if the key exists
  • Should return a error if the key doesn't exist or does exist but the TTL has expired

Command: CHK

CHK is a command that checks if a key is set or not

  • Should return a falsy response if the key doesn't exist
  • Should return a truthy response if the key exists
  • Should return a falsy response if the key does exist by the TTL has expired

Run DEL command on each discovered expired key when invoking is_valid method of KeyObject

currently expired keys just sit the datastore indefinitely

there is a new is_valid routine in the KeyObject class 1075d2b#diff-89e9fd90feb499cac1623bd562b7c8e3R33

This can be universally queried on discovered keys to determine if the key found isn't expired.

Once the #7 is accomplished, we should fire off a new thread to delete the key in the background and simply negate the result from further deliberation

Command: FND

FNS is a command that finds keys that contain a value based on a search query

  • Supplying nothing should throw an error
  • Supplying a value not wrapped in quotes should throw an error
  • Supplying * as the value should return everything
  • Supplying mykey* should only return values that start with mykey
  • Supplying *mykey should only return values the end with mykey
  • Supplying *mykey* should only return values that mykey is apart of in general

Command: TTL

TTL is a command that updates an existing key with a new time to live.

  • Supply a truthy value if TTL was updated
  • Supply a falsey value if key doesn't exist or TTL is expired.

Command: KEY

KEY is a command that lets you find existing keys based on a search query

  • Supplying nothing should throw an error
  • Supplying a search value wrapped in quotes should not throw an error as keys cannot exist with a space in them
  • Supplying * as the value should return everything
  • Supplying mykey* should only return values that start with mykey
  • Supplying *mykey should only return values the end with mykey
  • Supplying *mykey* should only return values that mykey is apart of in general

Command: DEL

DEL is a command that allows deleting of one or more keys

  • Returns a truthy value is key has been successfully removed
  • Allow a comma deliminated list of keys to delete more than one per command
  • Allow a fuzzymatch pattern as with #2 to delete keys based on key match
  • Return a falsy value if there were any issues

Command: SET

SET command simply allows one to create or update a key with a new value

  • Returns a truthy value if the key was stored successfully
  • If there was an issue, returns a clear error message
  • Optionally allow user to supply an inline TTL value without having to execute a follow up command

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.