The Wayback Machine - https://web.archive.org/web/20201214160317/https://github.com/dgraph-io/dgraph/commit/8bc041e85c63cca8bcdbf08922d77c3d46d5dc52
Skip to content
Permalink
Browse files

Changing DGraph to Dgraph

  • Loading branch information
pawanrawal committed Jun 22, 2016
1 parent d1c6732 commit 8bc041e85c63cca8bcdbf08922d77c3d46d5dc52
@@ -1,4 +1,4 @@
# Dockerfile for DGraph
# Dockerfile for Dgraph

FROM golang:1.6.2
MAINTAINER Manish Jain <manishrjain@gmail.com>
@@ -18,7 +18,7 @@ RUN mkdir /installs && cd /installs && \
RUN cd /installs/rocksdb && make shared_lib && make install
ENV LD_LIBRARY_PATH "/usr/local/lib"

# Install DGraph and update dependencies to right versions.
# Install Dgraph and update dependencies to right versions.
RUN go get -v github.com/dgraph-io/dgraph/... && \
go build -v github.com/dgraph-io/dgraph/... && \
go test github.com/dgraph-io/dgraph/... && echo "v0.3"
@@ -1,4 +1,4 @@
# DGraph
# Dgraph
**Scalable, Distributed, Low Latency, High Throughput Graph Database.**

![logo](https://img.shields.io/badge/status-alpha-red.svg)
@@ -7,9 +7,9 @@
[![Slack Status](http://slack.dgraph.io/badge.svg)](http://slack.dgraph.io)


DGraph's goal is to provide [Google](https://www.google.com) production level scale and throughput,
Dgraph's goal is to provide [Google](https://www.google.com) production level scale and throughput,
with low enough latency to be serving real time user queries, over terabytes of structured data.
DGraph supports [GraphQL](http://graphql.org/) as query language, and responds in [JSON](http://www.json.org/).
Dgraph supports [GraphQL](http://graphql.org/) as query language, and responds in [JSON](http://www.json.org/).

---

@@ -40,18 +40,18 @@ Please see [Release notes](https://github.com/dgraph-io/dgraph/releases/tag/v0.3
and [Trello board](https://trello.com/b/PF4nZ1vH) for more information.

`Mar 2016 - Branch v0.2`
This is the first truly distributed version of DGraph.
This is the first truly distributed version of Dgraph.
Please see the [release notes here](https://discuss.dgraph.io/t/dgraph-v0-2-release/17).

`MVP launch - Dec 2015 - Branch v0.1`
This is a minimum viable product, alpha release of DGraph. **It's not meant for production use.**
This is a minimum viable product, alpha release of Dgraph. **It's not meant for production use.**
This version is not distributed and support for GraphQL is partial.
[See the Roadmap](https://github.com/dgraph-io/dgraph/issues/1) for list of working and planned features.

Your feedback is welcome. Feel free to [file an issue](https://github.com/dgraph-io/dgraph/issues)
when you encounter bugs and to direct the development of DGraph.
when you encounter bugs and to direct the development of Dgraph.

There's an instance of DGraph running at http://dgraph.xyz, that you can query without installing DGraph.
There's an instance of Dgraph running at http://dgraph.xyz, that you can query without installing Dgraph.
This instance contains 21M facts from [Freebase Film Data](http://www.freebase.com/film).
See [Queries and Mutations below](#queries-and-mutations) for sample queries.
`curl dgraph.xyz/query -XPOST -d '{}'`
@@ -60,7 +60,7 @@ See [Queries and Mutations below](#queries-and-mutations) for sample queries.
## Quick Testing

### Single instance via Docker
There's a docker image that you can readily use for playing with DGraph.
There's a docker image that you can readily use for playing with Dgraph.
```
$ docker pull dgraph/dgraph:latest
# Setting a `somedir` volume on the host will persist your data.
@@ -103,7 +103,7 @@ $ tar -xzvf uids.async.tar.gz -C $DIR
$ tar -xzvf postings.tar.gz -C $DIR
# You should now see directories p0, p1, p2 and uasync.final. The last directory name is unfortunate, but made sense at the time.
```
For quick testing, you can bring up 3 different processes of DGraph. You can of course, also set this up across multiple servers.
For quick testing, you can bring up 3 different processes of Dgraph. You can of course, also set this up across multiple servers.
```
go build . && ./dgraph --instanceIdx 0 --mutations $DIR/m0 --port 8080 --postings $DIR/p0 --workers ":12345,:12346,:12347" --uids $DIR/uasync.final --workerport ":12345" &
go build . && ./dgraph --instanceIdx 1 --mutations $DIR/m1 --port 8082 --postings $DIR/p1 --workers ":12345,:12346,:12347" --workerport ":12346" &
@@ -123,7 +123,7 @@ All the instructions below are based on a Debian/Ubuntu system.
Download and install [Go 1.6 from here](https://golang.org/dl/).

### Install RocksDB
DGraph depends on [RocksDB](https://github.com/facebook/rocksdb) for storing posting lists.
Dgraph depends on [RocksDB](https://github.com/facebook/rocksdb) for storing posting lists.

```
# First install dependencies.
@@ -143,8 +143,8 @@ This would install RocksDB library in `/usr/local/lib`. Make sure that your `LD_
export LD_LIBRARY_PATH="/usr/local/lib"
```

### Install DGraph
Now get [DGraph](https://github.com/dgraph-io/dgraph) code. DGraph uses `govendor` to fix dependency versions. Version information for these dependencies is included in the `github.com/dgraph-io/dgraph/vendor` directory under the `vendor.json` file.
### Install Dgraph
Now get [Dgraph](https://github.com/dgraph-io/dgraph) code. Dgraph uses `govendor` to fix dependency versions. Version information for these dependencies is included in the `github.com/dgraph-io/dgraph/vendor` directory under the `vendor.json` file.

```
go get -u github.com/kardianos/govendor
@@ -221,7 +221,7 @@ using SSD persistent disk. Instance 2 took a bit longer, and finished in 15 mins
Note that `stw_ram_mb` is based on the memory usage perceived by Golang. It currently doesn't take into account the memory usage by RocksDB. So, the actual usage is higher.

### Server
Now that the data is loaded, you can run the DGraph servers. To serve the 3 shards above, you can follow the [same steps as here](#multiple-distributed-instances).
Now that the data is loaded, you can run the Dgraph servers. To serve the 3 shards above, you can follow the [same steps as here](#multiple-distributed-instances).
Now you can run GraphQL queries over freebase film data like so:
```
curl localhost:8080/query -XPOST -d '{
@@ -284,7 +284,7 @@ Consecutive runs of the same query took much lesser time (80 to 100ms), due to p

## Queries and Mutations
You can see a list of [sample queries here](https://discuss.dgraph.io/t/list-of-test-queries/22).
DGraph also supports mutations via GraphQL syntax.
Dgraph also supports mutations via GraphQL syntax.
Because GraphQL mutations don't contain complete data, the mutation syntax uses [RDF NQuad format](https://www.w3.org/TR/n-quads/).
```
mutation {
@@ -298,7 +298,7 @@ mutation {
```

You can batch multiple NQuads in a single GraphQL query.
DGraph would assume that any data in `<>` is an external id (XID),
Dgraph would assume that any data in `<>` is an external id (XID),
and it would retrieve or assign unique internal ids (UID) automatically for these.
You can also directly specify the UID like so: `_uid_: 0xhexval` or `_uid_: intval`.

@@ -320,7 +320,7 @@ query {
The query portion is executed after the mutation, so this would return `greg` as one of the results.


## Contributing to DGraph
## Contributing to Dgraph
- See a list of issues [that we need help with](https://github.com/dgraph-io/dgraph/issues?q=is%3Aissue+is%3Aopen+label%3Ahelp_wanted).
- Please see [contributing to Dgraph](https://discuss.dgraph.io/t/contributing-to-dgraph/20) for guidelines on contributions.
- *Alpha Program*: If you want to contribute to Dgraph on a continuous basis and need some Bitcoins to pay for healthy food, talk to us.
@@ -334,5 +334,5 @@ The query portion is executed after the mutation, so this would return `greg` as
- [Lightening Talk](http://go-talks.appspot.com/github.com/dgraph-io/dgraph/present/sydney5mins/g.slide#1) on 29th Oct, 2015 at Go meetup, Sydney.

## About
I, [Manish R Jain](https://twitter.com/manishrjain), the author of DGraph, used to work on Google Knowledge Graph.
I, [Manish R Jain](https://twitter.com/manishrjain), the author of Dgraph, used to work on Google Knowledge Graph.
My experience building large scale, distributed (Web Search and) Graph systems at Google is what inspired me to build this.
@@ -40,7 +40,7 @@ func main() {
}
defer conn.Close()

c := graph.NewDGraphClient(conn)
c := graph.NewDgraphClient(conn)

resp, err := c.Query(context.Background(), &graph.Request{Query: *q})
if err != nil {
@@ -1,5 +1,5 @@
/*
* Copyright 201666666 DGraph Labs, Inc.
* Copyright 2016 Dgraph Labs, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -214,7 +214,7 @@ func queryHandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, string(js))
}

// server is used to implement graph.DGraphServer
// server is used to implement graph.DgraphServer
type server struct{}

// This method is used to execute the query and return the response to the
@@ -290,7 +290,7 @@ func (s *server) Query(ctx context.Context,
return resp, err
}

// This function register a DGraph grpc server on the address, which is used
// This function register a Dgraph grpc server on the address, which is used
// exchanging protocol buffer messages.
func runGrpcServer(address string) {
ln, err := net.Listen("tcp", address)
@@ -301,7 +301,7 @@ func runGrpcServer(address string) {
log.Printf("Client worker listening: %v", ln.Addr())

s := grpc.NewServer()
graph.RegisterDGraphServer(s, &server{})
graph.RegisterDgraphServer(s, &server{})
if err = s.Serve(ln); err != nil {
log.Fatalf("While serving gRpc requests", err)
}
@@ -1,6 +1,6 @@
# Dgraph Design Doc

To explain DGraph working, let's start with an example query we should be able
To explain Dgraph working, let's start with an example query we should be able
to run.

Query to answer:
@@ -60,7 +60,7 @@ as the mode of communication.
- Versioning of data wouldn't be provided in this, or later versions. The best way I can
currently think of to do versioning would involve writing the deltas, and reading them back
to generate the final state. This would be too slow and memory consuming for generating the
long posting lists that we'll encounter in DGraph.
long posting lists that we'll encounter in Dgraph.

## Terminology

@@ -1,6 +1,6 @@
This is a post to announce DGraph, an open source, distributed, scalable native graph database. DGraph is designed to handle terabytes of structured data, over commodity hardware.
This is a post to announce Dgraph, an open source, distributed, scalable native graph database. Dgraph is designed to handle terabytes of structured data, over commodity hardware.

The design and inspiration is drawn from my experiences working in Google Knowledge Infra group. DGraph is under active development, and is looking to hire talented engineers.
The design and inspiration is drawn from my experiences working in Google Knowledge Infra group. Dgraph is under active development, and is looking to hire talented engineers.

Github page: https://github.com/dgraph-io/dgraph

@@ -1,4 +1,4 @@
DGraph
Dgraph
Go Meetup Sydney
29 Oct 2015
Tags: go golang dgraph graph
@@ -20,11 +20,11 @@ manishrjain@gmail.com

.image graph.png

* What is DGraph
* What is Dgraph

[[https://github.com/dgraph-io/dgraph][https://github.com/dgraph-io/dgraph]]

DGraph is an open source, distributed, low-latency graph serving system written in Go.
Dgraph is an open source, distributed, low-latency graph serving system written in Go.

- *Low*Latency*: Minimize the latency of query execution.

Some generated files are not rendered by default. Learn more.

@@ -4,7 +4,7 @@
syntax="proto3";
package graph;

service DGraph {
service Dgraph {
rpc Query (Request) returns (Response) {}
}

@@ -75,16 +75,16 @@ ok github.com/dgraph-io/dgraph/store 55.029s
```

### Thoughts
DGraph uses append only commit log to sync new mutations to disk before returning.
Dgraph uses append only commit log to sync new mutations to disk before returning.
Every time a posting list gets init, it checks for both the stored posting list and
the mutations committed after the posting list was written. Hence, our access pattern
from store is largely read-only, with fewer writes. This is true, irrespective of how
many writes get commited by the end user.

Hence, BoltDB is a better choice. It performs better for reads/seeks, despite DGraph needing
Hence, BoltDB is a better choice. It performs better for reads/seeks, despite Dgraph needing
a value copy. Writes are somewhat slower, but that shouldn't be a problem because of the
above mentioned reasons.

**Update**: Just realized that BoltDB only allows a SINGLE writer at any point in time.
This is equivalent to a global mutex lock. That'd essentially kill DGraph's performance. So,
This is equivalent to a global mutex lock. That'd essentially kill Dgraph's performance. So,
BoltDB is out!

0 comments on commit 8bc041e

Please sign in to comment.
You can’t perform that action at this time.