Getting Started With Dgraph and GraphQL+-

Introduction

I have spent a career building business applications that work with databases, starting with SQL and then moving to No-SQL. I’ve been curious how Graph databases work and how to build applications with them. It seems the sweet spot for a Graph database is when your application needs to model the interrelationships of complex and different datasets. I’ve been using No-SQL databases for these types of applications so I am super interested in knowing how Graph databases differ. After some research, I decided to learn Dgraph and their modified version of GraphQL called GraphQL±.

Dgraph is written in Go and is a relatively new player in the Graph database market. GraphQL is becoming the new DSL for interacting with the database. Since GraphQL wasn’t developed directly for Graph databases, Dgraph modified the language (adding and removing features) to better support graph operations and called it GraphQL±. However when interacting with Dgraph, you do have the choice of using native GraphQL as well.

Note: Dgraph is working on full native support for GraphQL in an upcoming release. You can start experimenting with it now. Native GraphQL will be available to perform basic CRUD and other simple operations. However, you will need GraphQL± to make use of the the full potential of the database.

In this post, I will show you how to install and run a standalone version of Dgraph for use in your development environment. Then I will walk you through a simple example using Dgraph’s UI browser tool Ratel to store and query data from the database using GraphQL±.

Docker

The best way to run Dgraph on your local machine is to use Docker. If you don’t have Docker installed yet, then please use this guide from Docker.

As of the writing of this post, version 20.03.0 is the latest release of the database. To download this version of the Dgraph image, just use the docker pull command.

Listing 1

$ docker pull dgraph/standalone:v20.03.0

OUTPUT
v20.03.0: Pulling from dgraph/dgraph
6abc03819f3e: Pull complete
05731e63f211: Pull complete
0bd67c50d6be: Pull complete
2f379a822eb5: Pull complete
a676ba663810: Pull complete
971811531d21: Pull complete
7ea90bf23378: Pull complete
f017dbb5d80b: Pull complete
Digest: sha256:92aac5559d4040571bfae5e84a946101be0f31971950893fd32de7adeeefc15d
Status: Downloaded newer image for dgraph/standalone:v20.03.0
docker.io/dgraph/standalone:v20.03.0

Listing 1 shows the docker pull command that will download a standalone version of Dgraph and prepare Dgraph to run inside a container. Once all the different file layers are downloaded, you can run the docker images command to validate the pull.

Listing 2

$ docker images

OUTPUT
REPOSITORY          TAG        IMAGE ID       CREATED       SIZE
dgraph/standalone   v20.03.0   6875d1f402fa   10 days ago    153MB

Listing 2 shows the call to docker images and the expected output for the Dgraph image. To validate this image works, attempt to run the container.

Listing 3

$ docker run -it -p 8080:8080 -p 9080:9080 -p 8000:8000 dgraph/standalone:v20.03.0

OUTPUT
Warning: This standalone version is meant for quickstart purposes only.
         It is NOT RECOMMENDED for production environments.
2020/04/10 14:07:40 Listening on :8000...
[Decoder]: Using assembly version of decoder

Listing 3 shows the docker run command to use to get Dgraph up and running. Notice the message about this version of Dgraph is not meant for production use. You will use this version for local development and testing. Also notice the three ports that should be exposed: 8080, 9080, and 8000.

To verify this standalone version is working, open your browser and navigate to localhost:8000.

Figure 1

Figure 1 shows the home page to access the Dgraph tool for interacting with the database. Click on the center box to run the Latest version if you want to explore more.

To stop and remove the container, find the container id and then use the docker stop and docker rm command.

Listing 4

$ docker ps

OUTPUT
CONTAINER ID     IMAGE                         COMMAND
fdf70d833dd8     dgraph/standalone:v20.03.0    "./run.sh"

$ docker stop fdf70d833dd8
$ docker rm fdf70d833dd8

OUTPUT

Listing 4 shows how to find the id of the running Dgraph container and then stop and remove it. You can also hit C in the terminal window running Dgraph to perform these same actions.

#graphql

What is GEEK

Buddha Community

Getting Started With Dgraph and GraphQL+-
Tyrique  Littel

Tyrique Littel

1600369200

Getting started with GraphQL

The world is a stage where all of us are artists. Constant learning is the foundation of success. So, here we are going to learn about a query language introduced by Facebook back in 2015, which is GraphQL. In this blog, we will cover the basics of GraphQL.

Overview

GraphQL is a query language(that’s what QL stands for) for your API and a server-side runtime for executing queries. Basically, it is used to load data from a server to a client(it’s a way to get data from an API into your application). GraphQL isn’t tied to any specific database or storage engine and is instead backed by your existing code and data.

#api's #functional programming #graphql #java #java11 #tech blogs #api #functional java #graphql #java

Carmen  Grimes

Carmen Grimes

1595494844

How to start an electric scooter facility/fleet in a university campus/IT park

Are you leading an organization that has a large campus, e.g., a large university? You are probably thinking of introducing an electric scooter/bicycle fleet on the campus, and why wouldn’t you?

Introducing micro-mobility in your campus with the help of such a fleet would help the people on the campus significantly. People would save money since they don’t need to use a car for a short distance. Your campus will see a drastic reduction in congestion, moreover, its carbon footprint will reduce.

Micro-mobility is relatively new though and you would need help. You would need to select an appropriate fleet of vehicles. The people on your campus would need to find electric scooters or electric bikes for commuting, and you need to provide a solution for this.

To be more specific, you need a short-term electric bike rental app. With such an app, you will be able to easily offer micro-mobility to the people on the campus. We at Devathon have built Autorent exactly for this.

What does Autorent do and how can it help you? How does it enable you to introduce micro-mobility on your campus? We explain these in this article, however, we will touch upon a few basics first.

Micro-mobility: What it is

micro-mobility

You are probably thinking about micro-mobility relatively recently, aren’t you? A few relevant insights about it could help you to better appreciate its importance.

Micro-mobility is a new trend in transportation, and it uses vehicles that are considerably smaller than cars. Electric scooters (e-scooters) and electric bikes (e-bikes) are the most popular forms of micro-mobility, however, there are also e-unicycles and e-skateboards.

You might have already seen e-scooters, which are kick scooters that come with a motor. Thanks to its motor, an e-scooter can achieve a speed of up to 20 km/h. On the other hand, e-bikes are popular in China and Japan, and they come with a motor, and you can reach a speed of 40 km/h.

You obviously can’t use these vehicles for very long commutes, however, what if you need to travel a short distance? Even if you have a reasonable public transport facility in the city, it might not cover the route you need to take. Take the example of a large university campus. Such a campus is often at a considerable distance from the central business district of the city where it’s located. While public transport facilities may serve the central business district, they wouldn’t serve this large campus. Currently, many people drive their cars even for short distances.

As you know, that brings its own set of challenges. Vehicular traffic adds significantly to pollution, moreover, finding a parking spot can be hard in crowded urban districts.

Well, you can reduce your carbon footprint if you use an electric car. However, electric cars are still new, and many countries are still building the necessary infrastructure for them. Your large campus might not have the necessary infrastructure for them either. Presently, electric cars don’t represent a viable option in most geographies.

As a result, you need to buy and maintain a car even if your commute is short. In addition to dealing with parking problems, you need to spend significantly on your car.

All of these factors have combined to make people sit up and think seriously about cars. Many people are now seriously considering whether a car is really the best option even if they have to commute only a short distance.

This is where micro-mobility enters the picture. When you commute a short distance regularly, e-scooters or e-bikes are viable options. You limit your carbon footprints and you cut costs!

Businesses have seen this shift in thinking, and e-scooter companies like Lime and Bird have entered this field in a big way. They let you rent e-scooters by the minute. On the other hand, start-ups like Jump and Lyft have entered the e-bike market.

Think of your campus now! The people there might need to travel short distances within the campus, and e-scooters can really help them.

How micro-mobility can benefit you

benefits-micromobility

What advantages can you get from micro-mobility? Let’s take a deeper look into this question.

Micro-mobility can offer several advantages to the people on your campus, e.g.:

  • Affordability: Shared e-scooters are cheaper than other mass transportation options. Remember that the people on your campus will use them on a shared basis, and they will pay for their short commutes only. Well, depending on your operating model, you might even let them use shared e-scooters or e-bikes for free!
  • Convenience: Users don’t need to worry about finding parking spots for shared e-scooters since these are small. They can easily travel from point A to point B on your campus with the help of these e-scooters.
  • Environmentally sustainable: Shared e-scooters reduce the carbon footprint, moreover, they decongest the roads. Statistics from the pilot programs in cities like Portland and Denver showimpressive gains around this key aspect.
  • Safety: This one’s obvious, isn’t it? When people on your campus use small e-scooters or e-bikes instead of cars, the problem of overspeeding will disappear. you will see fewer accidents.

#android app #autorent #ios app #mobile app development #app like bird #app like bounce #app like lime #autorent #bird scooter business model #bird scooter rental #bird scooter rental cost #bird scooter rental price #clone app like bird #clone app like bounce #clone app like lime #electric rental scooters #electric scooter company #electric scooter rental business #how do you start a moped #how to start a moped #how to start a scooter rental business #how to start an electric company #how to start electric scooterrental business #lime scooter business model #scooter franchise #scooter rental business #scooter rental business for sale #scooter rental business insurance #scooters franchise cost #white label app like bird #white label app like bounce #white label app like lime

How to Get Current URL in Laravel

In this small post we will see how to get current url in laravel, if you want to get current page url in laravel then we can use many method such type current(), full(), request(), url().

Here i will give you all example to get current page url in laravel, in this example i have used helper and function as well as so let’s start example of how to get current url id in laravel.

Read More : How to Get Current URL in Laravel

https://websolutionstuff.com/post/how-to-get-current-url-in-laravel


Read More : Laravel Signature Pad Example

https://websolutionstuff.com/post/laravel-signature-pad-example

#how to get current url in laravel #laravel get current url #get current page url in laravel #find current url in laravel #get full url in laravel #how to get current url id in laravel

Getting Started With Dgraph and GraphQL+-

Introduction

I have spent a career building business applications that work with databases, starting with SQL and then moving to No-SQL. I’ve been curious how Graph databases work and how to build applications with them. It seems the sweet spot for a Graph database is when your application needs to model the interrelationships of complex and different datasets. I’ve been using No-SQL databases for these types of applications so I am super interested in knowing how Graph databases differ. After some research, I decided to learn Dgraph and their modified version of GraphQL called GraphQL±.

Dgraph is written in Go and is a relatively new player in the Graph database market. GraphQL is becoming the new DSL for interacting with the database. Since GraphQL wasn’t developed directly for Graph databases, Dgraph modified the language (adding and removing features) to better support graph operations and called it GraphQL±. However when interacting with Dgraph, you do have the choice of using native GraphQL as well.

Note: Dgraph is working on full native support for GraphQL in an upcoming release. You can start experimenting with it now. Native GraphQL will be available to perform basic CRUD and other simple operations. However, you will need GraphQL± to make use of the the full potential of the database.

In this post, I will show you how to install and run a standalone version of Dgraph for use in your development environment. Then I will walk you through a simple example using Dgraph’s UI browser tool Ratel to store and query data from the database using GraphQL±.

Docker

The best way to run Dgraph on your local machine is to use Docker. If you don’t have Docker installed yet, then please use this guide from Docker.

As of the writing of this post, version 20.03.0 is the latest release of the database. To download this version of the Dgraph image, just use the docker pull command.

Listing 1

$ docker pull dgraph/standalone:v20.03.0

OUTPUT
v20.03.0: Pulling from dgraph/dgraph
6abc03819f3e: Pull complete
05731e63f211: Pull complete
0bd67c50d6be: Pull complete
2f379a822eb5: Pull complete
a676ba663810: Pull complete
971811531d21: Pull complete
7ea90bf23378: Pull complete
f017dbb5d80b: Pull complete
Digest: sha256:92aac5559d4040571bfae5e84a946101be0f31971950893fd32de7adeeefc15d
Status: Downloaded newer image for dgraph/standalone:v20.03.0
docker.io/dgraph/standalone:v20.03.0

Listing 1 shows the docker pull command that will download a standalone version of Dgraph and prepare Dgraph to run inside a container. Once all the different file layers are downloaded, you can run the docker images command to validate the pull.

Listing 2

$ docker images

OUTPUT
REPOSITORY          TAG        IMAGE ID       CREATED       SIZE
dgraph/standalone   v20.03.0   6875d1f402fa   10 days ago    153MB

Listing 2 shows the call to docker images and the expected output for the Dgraph image. To validate this image works, attempt to run the container.

Listing 3

$ docker run -it -p 8080:8080 -p 9080:9080 -p 8000:8000 dgraph/standalone:v20.03.0

OUTPUT
Warning: This standalone version is meant for quickstart purposes only.
         It is NOT RECOMMENDED for production environments.
2020/04/10 14:07:40 Listening on :8000...
[Decoder]: Using assembly version of decoder

Listing 3 shows the docker run command to use to get Dgraph up and running. Notice the message about this version of Dgraph is not meant for production use. You will use this version for local development and testing. Also notice the three ports that should be exposed: 8080, 9080, and 8000.

To verify this standalone version is working, open your browser and navigate to localhost:8000.

Figure 1

Figure 1 shows the home page to access the Dgraph tool for interacting with the database. Click on the center box to run the Latest version if you want to explore more.

To stop and remove the container, find the container id and then use the docker stop and docker rm command.

Listing 4

$ docker ps

OUTPUT
CONTAINER ID     IMAGE                         COMMAND
fdf70d833dd8     dgraph/standalone:v20.03.0    "./run.sh"

$ docker stop fdf70d833dd8
$ docker rm fdf70d833dd8

OUTPUT

Listing 4 shows how to find the id of the running Dgraph container and then stop and remove it. You can also hit C in the terminal window running Dgraph to perform these same actions.

#graphql

Nikunj Shah

Nikunj Shah

1591685365

Getting Started With Dgraph and GraphQL+-

Introduction

I have spent a career building business applications that work with databases, starting with SQL and then moving to No-SQL. I’ve been curious how Graph databases work and how to build applications with them. It seems the sweet spot for a Graph database is when your application needs to model the interrelationships of complex and different datasets. I’ve been using No-SQL databases for these types of applications so I am super interested in knowing how Graph databases differ. After some research, I decided to learn Dgraph and their modified version of GraphQL called GraphQL±.

Dgraph is written in Go and is a relatively new player in the Graph database market. GraphQL is becoming the new DSL for interacting with the database. Since GraphQL wasn’t developed directly for Graph databases, Dgraph modified the language (adding and removing features) to better support graph operations and called it GraphQL±. However when interacting with Dgraph, you do have the choice of using native GraphQL as well.

Note: Dgraph is working on full native support for GraphQL in an upcoming release. You can start experimenting with it now. Native GraphQL will be available to perform basic CRUD and other simple operations. However, you will need GraphQL± to make use of the the full potential of the database.

In this post, I will show you how to install and run a standalone version of Dgraph for use in your development environment. Then I will walk you through a simple example using Dgraph’s UI browser tool Ratel to store and query data from the database using GraphQL±.

Docker

The best way to run Dgraph on your local machine is to use Docker. If you don’t have Docker installed yet, then please use this guide from Docker.

As of the writing of this post, version 20.03.0 is the latest release of the database. To download this version of the Dgraph image, just use the docker pull command.

#graphql #database #web-development #developer