Skip to content
This repository has been archived by the owner on Jul 28, 2021. It is now read-only.

ShindouMihou/RoseDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RoseDB

Maintenance Build Status Release Discord Commits CodeFactor GitHub

❤️ What is RoseDB?

RoseDB is a simple, NoSQL database that is written completely in Java containing the most basic functions that is needed for a database. This project was initially created as a random project for me (a shower thought) but has evolved into a learning experience for me.

⚙️ How does it work

RoseDB works with both in-memory and file data storage, for every request it receives, it stores it on a queue and also on its cache which will be saved immediately at an interval of 5 seconds to the specified directory. It utilizes websockets to receive and send data to clients and should be more than capable to process plenty of requests per second.

✨ Goal

My primary goal/aim of this project is not to create a simple but decent database that can get you up and running in literal mere seconds with little to no configuration at all.

Are you not convinced? Have a look at our no-configuration setup.

  1. Download the jar from Releases.
  2. Run the jar from a console: java -jar RoseDB.jar.
  3. Type in your Authorization code (be sure to remember it) then restart the application.
  4. Install one of our drivers (for example, the official Java driver) and follow the instructions to use the driver.

🛡️ Security

RoseDB has support for websocket SSL which counts as security and also an Authorization header enforcement with the header being compared with hash (it is written to the disk as a hash value for security), there will be more security features and if you have more to suggest then feel free to send a Pull Request or an Issue explaining everything. We are always focusing our attention to bringing more security features onto the application but since we are still in our very early stages, we are trying to get everything up and running first before focusing on security.

Though, in my opinion, RoseDB is more suited to be used in simple applications like tiny Discord bots that is shared among friends and not large applications that require super complicated features, after all, the main aim of RoseDB is to be as simple as possible and that involves replication and load balancing (future).

🖥️ Requirements

  • JDK 11 (Preferably, OpenJDK 11).
  • An computer with storage, memory and a terminal.
  • A keyboard that you can type on.
  • Internet Connection (to download the JAR file, naturally).

🖱️ Installation

Installation of RoseDB is simple, all you need is JDK 11 (Preferably, OpenJDK 11) and tier-one extreme basic knowledge of JSON. Here are the steps of installing RoseDB.

  1. Download RoseDB.jar from the Releases on GitHub.
  2. Place RoseDB.jar on its dedicated, empty folder.
  3. Open Terminal or Powershell then execute the following line: java -jar RoseDB.jar
  4. OPTIONAL CTRL C (or exit) the application then head to the folder where you will find a config.json.
  5. OPTIONAL Configure the JSON config as you like.
  6. OPTIONAL Run the jar file again with the same line: java -jar RoseDB.jar

📝 Configuration

Configuration of RoseDB is straightforward, here is an example of a configuration file (it is on JSON format).

FIELD TYPE DESCRIPTION DEFAULT VALUE
Cores integer The number of cores the application should use. 1
maxTextMessageBufferSizeMB integer The maximum message buffer size for each message (request) received (MB) 5
maxTextMessageSizeMB integer The maximum text (message/request) size to receive (MB) 5
port integer The port that RoseDB should use. 5995
versioning boolean Whether RoseDB should save a backup version for all items that are modified. (Recommended) true
preload boolean Whether to preload all items that are saved on the database. (Recommended) true
updateChecker boolean Whether to check for RoseDB updates from the maintainer's server. (Recommended) true
directory string The exact directory folder where RoseDB will save all the data. running location of the jar
heartbeatIntervalSeconds integer The interval seconds of when the server should send a heartbeat packet to all connections. 30
loggingLevel string The minimum level of which RoseDB should log (recommended at INFO for performance), options: INFO, WARNING, DEBUG, ERROR. INFO

💌 Wrappers

If you want to quickly get up and running with your application then feel free to use our wrappers.

🌠 How simple is RoseDB?

RoseDB is very simple and easy to use, after following Installation, you can quickly get up and running by sending requests to the server via Queria format or JSON format.

An example of a Queria GET request is:

database.collection.get(item)

An example of a Queria ADD request is:

database.collection.add(item, {"someKey":"someValue"})

Are you interested, learn more at our GitHub Wiki.

❤️‍🔥 Reporting a Vulnerability

To report a vulnerability, simply file an issue at Issue Template.

🚀 Add a suggestion

To suggest a new feature or some sort, feel free to send a suggestion issue at Suggestion Template

🌟 Maintainers

Shindou Mihou, creator and developer.

💫 Credits

  • Bucket4j for Rate-limiter.
  • TooTallNate for Websocket (replacing io.javalin).
  • Resilience4j for Retry and Timeouts.
  • Apache Commons for FilenameUtils, Hashing, FileUtils, Hash Validation.
  • org.json for JSON Decoding and Encoding.
  • GSON for JSON Serialization and Deserialization (working in tandem with org.json)