GithubHelp home page GithubHelp logo

hstreamdb / hstream Goto Github PK

View Code? Open in Web Editor NEW
692.0 23.0 56.0 6.27 MB

HStreamDB is an open-source, cloud-native streaming database for IoT and beyond. Modernize your data stack for real-time applications.

Home Page: https://hstream.io/

License: BSD 3-Clause "New" or "Revised" License

Haskell 85.82% Dockerfile 0.20% Shell 0.08% C++ 7.86% Python 3.81% Makefile 0.16% Thrift 1.89% C 0.06% Pawn 0.04% Smarty 0.07%
streaming database iot stream-processing haskell real-time sql hstreamdb scale distributed-systems

hstream's Introduction

GitHub top language ci Docker Pulls Slack Twitter Community YouTube

HStreamDB

HStreamDB is an open-source, cloud-native streaming database for IoT and beyond. Modernize your data stack for real-time applications.

hstream-db

Main Features

  • Push real-time data to your apps

    By subscribing to streams in HStreamDB, any update of the data stream will be pushed to your apps in real-time, and this promotes your apps to be more responsive.

    You can also replace message brokers with HStreamDB and everything you do with message brokers can be done better with HStreamDB.

  • Stream processing with familiar SQL

    HStreamDB provides built-in support for event time-based stream processing. You can use your familiar SQL to perform basic filtering and transformation operations, statistics and aggregation based on multiple kinds of time windows and even joining between multiple streams.

  • Easy integration with a variety of external systems

    With connectors provided, you can easily integrate HStreamDB with other external systems, such as MQTT Broker, MySQL, Redis and ElasticSearch. More connectors will be added.

  • Real-time query based on live materialized views

    With maintaining materialized views incrementally, HStreamDB enables you to gain ahead-of-the-curve data insights that respond to your business quickly.

  • Reliable persistent storage with low latency

    With an optimized storage design based on LogDevice, not only can HStreamDB provide reliable and persistent storage but also guarantee excellent performance despite large amounts of data written to it.

  • Seamless scaling and high availability

    With the architecture that separates compute from storage, both compute and storage layers of HStreamDB can be independently scaled seamlessly. And with the consensus algorithm based on the optimized Paxos, data is securely replicated to multiple nodes which ensures the high availability of our system.

For more information, please visit HStreamDB homepage.

Quickstart

For detailed instructions, follow HStreamDB quickstart.

  1. Install HStreamDB.
  2. Start a local standalone HStream server.
  3. Start HStreamDB's interactive CLI and create your first stream.
  4. Run a continuous query.
  5. Start another interactive CLI, then insert some data into the stream and get query results.

Documentation

Check out the documentation.

Community, Discussion, Construction and Support

You can reach the HStreamDB community and developers via the following channels:

Please submit any bugs, issues, and feature requests to hstreamdb/hstream.

How to build (for developers only)

Pre-requirements

  1. You have python3 and docker installed.
  2. [Optional] You can run docker without sudo. For details, see this docs
  3. [Optional] You can clone the GitHub repository by ssh key.

Get the source code

git clone --recursive [email protected]:hstreamdb/hstream.git
cd hstream/

Update images

script/dev-tools update-images

Start all required services

You must have all required services started before entering an interactive shell to do further development (especially for running tests).

script/dev-tools start-services

To see information about all started services, run

script/dev-tools info

All datas are stored under your-project-root/local-data

Enter in an interactive shell

script/dev-tools shell

Build as other Haskell projects

Inside the interactive shell, you have all extra dependencies installed.

I have no name!@649bc6bb75ed:~$ cabal update
I have no name!@649bc6bb75ed:~$ make
I have no name!@649bc6bb75ed:~$ cabal build all

License

HStreamDB is under the BSD 3-Clause license. See the LICENSE file for details.

Acknowledgments

  • Thanks LogDevice for the powerful storage engine.

hstream's People

Contributors

4euep avatar alissa-tung avatar commelina avatar crazywisdom avatar daleiz avatar emqplus avatar rory-z avatar s12f avatar savonarola avatar sdzx-1 avatar swilder-m avatar time-hu avatar wfnuser avatar winterland1989 avatar yangkian avatar yu-zh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hstream's Issues

Details about how to build hstream through docker

  • How to build Haskell projects by docker? ( with some extra shared library, e.g., logdevice, zookeeper
  • How to make Haskell-Language-Server work?
  • If I want to edit locally and build remotely, show me the steps.

FAQs:

  • Q: Why my hls doesn't find hsc2hs but cabal build success?
  • A: Short answer: run cabal install hsc2hs

hstore: more logdevice admin api

  • getVersion: wrapper for getVersion() Thrift method
  • getStatus: wrapper for getStatus() Thrift method
  • aliveSince: wrapper for aliveSince() Thrift method
  • getPid: wrapper for getPid() Thrift method
  • get_nodes_state
  • add_nodes
  • update_nodes
  • remove_nodes
  • get_nodes_config
  • add_nodes
  • update_nodes
  • remove_nodes
  • mark_shards_as_provisioned
  • bump_node_generation
  • get_maintenances
  • apply_maintenance
  • remove_maintenances
  • mark_all_shards_unrecoverable
  • check_impact
  • get_log_tree_info
  • get_replication_info
  • get_settings
  • take_log_tree_snapshot
  • take_maintenance_log_snapshot
  • get_log_group_throughput
  • get_log_group_custom_counters

Server will crash when executing `SELECT` query and then two `INSERT` queries

To reproduce the bug, run

  1. cabal run hstream-server
  2. cabal run hstream-client and then SELECT * FROM foo EMIT CHANGES;
  3. cabal run hstream-client and then two INSERT INTO foo (a, b) VALUES (1, 2);

Details:

hstream-server: Data.HashMap.Internal.(!): key not found
CallStack (from HasCallStack):
  error, called at ./Data/HashMap/Internal.hs:785:16 in unordered-containers-0.2.14.0-4623fa3c6c98778c0d1a2c886970786fa56dd6d9087fb385e168ce0ef5ba869b:Data.HashMap.Internal
  !, called at src/HStream/Processing/Processor.hs:130:49 in hstream-processing-0.1.0.0-inplace:HStream.Processing.Processor

It means that the processor crashed. Logs say that the srcStream in the second SourceRecord does not match the real one:

2021-06-08 07:34:58.410204: [debug] polled 1 records
@(src/HStream/Processing/Processor.hs:122:11)
2021-06-08 07:34:58.410312: [debug] ---------------------------------
@(src/HStream/Processing/Processor.hs:126:17)
2021-06-08 07:34:58.410348: [debug] srcSource: fool﮿
@(src/HStream/Processing/Processor.hs:127:17)
2021-06-08 07:34:58.410377: [debug] expected: foo
@(src/HStream/Processing/Processor.hs:128:24)
2021-06-08 07:34:58.410406: [debug] ---------------------------------

hstream-server: error while loading shared libraries: libgrpc.so.14: cannot open shared object file: No such file or directory

I follow the Quickstart instructions, when I run this command
docker run -td --rm --name some-hstream-store -v dbdata:/data/store --network host hstreamdb/logdevice ld-dev-cluster --root /data/store --use-tcp ,
then shows
hstream-server: error while loading shared libraries: libgrpc.so.14: cannot open shared object file: No such file or directory
and Start HStreamDB Server command also

async version of write checkpoints

checkpointed reader

c api: "logdevice/include/CheckpointedReaderBase.h"

  • CheckpointedReaderBase.asyncWriteCheckpoints
  • CheckpointedReaderBase.asyncWriteCheckpoints (writeLastCheckpointsSync)

checkpoint store

c api: "logdevice/include/CheckpointStore.h"

  • CheckpointStore.getLSN
  • CheckpointStore.updateLSN

hstore-admin: logs show

logs show --path [...] --id [...] --max-depth ... --verbose

Tasks

  • Add logDirLogsNames
  • Add logDirChildFullName and logDirLogFullName, which will be used to get log groups and sub directories
  • Add logDirectoryGetAttrs
  • ldLogAttrsPtrToHsAttrs which reads attributes from a foreign pointer to a map in Haskell
  • Update optparser

API: delete & rename topic

  • rename topics. We need a HStream.Store.Stream.Topic.rename function to rename our topics. (Btw, a possible logdevice API is Client.rename.)
  • remove topics. (Client.removeLogGroup may help)

Create connector throw grpc error when stream subscribing doesn't exist

Describe the bug

> CREATE SOURCE | SINK CONNECTOR mysqltest22 WITH (type = "mysql", host = "0.0.0.0", port = 3306, streamname = "aaa") ;
Client Error: ClientIOError (GRPCIOBadStatusCode StatusCancelled (StatusDetails {unStatusDetails = "Cancelled"}))

To Reproduce
see above

Expected behavior
display warning: Stream doesn't exist

HStore: Return more detailed information instead of just StreamName in findStreams

Since we need to provide an admin dashboard.
We will need provide some http apis for stream. But now we can only get StreamNames from HStore by findStreams.
Maybe we should return more detailed information (such as replicationFactor and beginTimestamp) instead of just StreamName .
Also provide another api for query stream info by streamname.

Connect to HStreamDB server programmatically

I couldn't find any documentation on how I can connect with HStreamDB server programmatically. I am looking for Java connector. If the connector does not exist then what is the best way to create one.

(ConnectionFailure Network.Socket.connect: <socket: 12>: does not exist (Connection refused))

创建流,ctl 报错

CREATE STREAM demo WITH (FORMAT = "JSON");

HttpExceptionRequest Request {
host = "localhost"
port = 6570
secure = False
requestHeaders = [("Content-Type","application/json; charset=utf-8")]
path = "/create/query"
queryString = ""
method = "POST"
proxy = Nothing
rawBody = False
redirectCount = 10
responseTimeout = ResponseTimeoutDefault
requestVersion = HTTP/1.1
proxySecureMode = ProxySecureWithConnect
}
(ConnectionFailure Network.Socket.connect: <socket: 12>: does not exist (Connection refused))

HStream-Server 报错
hstream-server: LOGS_SECTION_MISSING {name:LOGS_SECTION_MISSING, description:LOGS_SECTION_MISSING: Configuration file misses logs section, callstack:CallStack (from HasCallStack):
throwStreamErrorIfNotOK', called at ./HStream/Store/Exception.hs:324:28 in hstream-store-0.1.0.0-00fd332cb31e900c02128ac35e4d993df94b7e2480f7781981c70e854378ff8e:HStream.Store.Exception}

ldshell command

Required but not implemented yet:

  • logs update
  • logs set-range
  • logs trim
  • nodes-config edit
  • nodes-config shrink
  • maintenance
  • SQL: show tables;
  • SQL: describe table_name;
  • SQL: select ...

Other commands in ldshell:

  • check-internal-logs

command "SELECT * FROM demo WHERE humidity > 70 EMIT CHANGES" parse error

>SELECT * FROM demo WHERE humidity > 70 EMIT CHANGES;
ParseException at <unknown position>: syntax error at line 1, column 40 before `EMIT'
CallStack (from HasCallStack):
  ParseException, called at src/HStream/SQL/Parse.hs:23:36 in hstream-sql-0.1.0.0-5c9dc46b93814cbb293cf4f8ba64a8d7fd1e433bdd707f130f0d94c72e0b6ca1:HStream.SQL.Parse
  parse, called at src/HStream/SQL/Parse.hs:30:24 in hstream-sql-0.1.0.0-5c9dc46b93814cbb293cf4f8ba64a8d7fd1e433bdd707f130f0d94c72e0b6ca1:HStream.SQL.Parse
  parseAndRefine, called at client/Main.hs:99:33 in main:Main

Following the steps in the quick start.

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.