Comments (12)
I personally like the idea of sqlite, but, I could be bias. I've wanted to find a project to learn GoLang with, and this one seems like a no brainer, small but complex and such. I have experience from other SQL providers, so obviously I'm quick to choose sqlite.
However my inner developer says we need to create interfaces and adapters for pluggable storage systems.
So how about an interface "storage" which relies on an adapters directory for storage systems that can be picked from?
This also naturally leads to a configuration file, which I believe should be simple and uncomplex. Maybe XML (though that seems overly complex for the job, but simple enough so that it can be read/understood by anybody) or standard ini style parsing.
The config file "system" should have some type of RFS, for example, if we choose XML, we need to discuss how the sections will lay out in the file. If we choose an INI based mechanism, we need to understand how the ini file sections will lay out.
So, I would say a pre-req to this ticket, is the creation of some type of configuration file and parser before this can be implemented.
from ssh-chat.
sqlite is my least favorite choice right now as relational schema-enforced is not beneficial for the problem at hand and adds a fair bit of code complexity to setup, maintain, and query.
I don't believe there is a need for a config file just yet, as long as the command-line flags remain simple enough.
I can confidently say that we are definitely not touching XML for anything. :)
from ssh-chat.
What is your opinion on interfacing the data storage layer then? I would love to attempt to tackle this :)
from ssh-chat.
@scrothers Can you explain what that is? I've never heard of it and google hasn't been too enlightening.
from ssh-chat.
http://en.wikipedia.org/wiki/Adapter_pattern
In this case, I believe it would look something like this (excuse my Go noobishness):
Class "storage" has several functions, which would be: whitelistadd, whitelistdel, opadd, opdel, etc.
This storage class is the "interface", but each function simply calls into the adapters, for example, one such adapter might be "storage_flatfile", which appends and reorders text files and exposes common functions to the interface, like "put, get, delete" or similar.
That way you can create more adapters later, say a "storage_dynamodb" and a "storage_sqlite" which expose the same "put, get, delete" functions that the interface can consume as a unified API for the rest of the application.
But that's it essentially, again, not a Go expert, so how it may be written or used in Go is a mystery to me.
from ssh-chat.
Oh, nice! This would just be a combination of all the aforementioned methods, leaving the decision to the user?
from ssh-chat.
That's the idea :) but with less rigid structure and with less inter-dependancy on a specific adapter.
The hip word I believe is "de-coupling".
from ssh-chat.
Decoupling makes sense when you have something to decouple, it's still too early to even know what we want to store or what we'll do with it. Further, depends which storage backend we choose will dictate how simple/complex the usage of it is and how we implement the feature.
You're welcome to tackle and propose an interface, but I suspect it's going to change a lot before it's put into use. :/
from ssh-chat.
my gut says flat-file is gonna be the preferred way to start - we already have configs/keys loading from files using commandline flags. plus this doesn't add any more dependencies for ppl to install their own ssh-chat on a server somewhere. simple and effective. but, after things settle down and are more stable, then creating an adapter layer would be the way to go, methinks.. then we can build adapters for other storage drivers
from ssh-chat.
👍 for flat file, not that I know anything Go related.
from ssh-chat.
Of the suggested options, I'm inclined to think either flatfile or leveldb would be the best options.
My understanding is that BoltDB is based on LMDB, which is rather slow at nonsequential writes. If this is the case, it does not strike me as the best option for a data storage format that will eventually be used for things like username registrations (because returning to the username to add more SSH keys to access ssh-chat from multiple computers might be important), for instance.
SQLite is great and has its uses, but it seems a bit hefty for this, and there are some legal issues in places that do not recognize a right to reliquish copyright.
from ssh-chat.
I think that it could be implemented in configuration so all storage methods are available (maybe letting the switching of the options at compile-time?)
from ssh-chat.
Related Issues (20)
- [Feature Request] Plugin support HOT 1
- Send messages on \n and not \r\n HOT 6
- Add system bell support to all messages, not just /msg or /reply's HOT 3
- Unable to start using `--unsafe-passphrase` HOT 1
- fuzzer crash HOT 1
- /op USER remove only works until USER reconnects HOT 1
- server: Support multiple identity private keys
- /back: Needs confirmation message
- Whitelist not applying HOT 10
- "ssh.chat" refuse connection HOT 2
- Latest DoS HOT 7
- 8 Vulnerable Dependences per OWASP Dependency Check HOT 2
- Known bug: ssh rsa negotiation issue HOT 5
- COMMANDS ARE CASE SENSITIVE HOT 5
- bot: Skip motd on connect HOT 2
- bot: Don't include emoji prefixes in DMs
- Emojis still appear in TERM=bot mode private messages HOT 1
- Release v1.11 proper HOT 1
- Couldn't connect with allowlist or get admin HOT 2
- problem with using backspace for Chinese characters(one char of 2 bytes) HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ssh-chat.