Join us on
Star us on
Get Started
Slack
GitHub
Get Started
v2.5 (latest) v2.2 (stable) v2.1 (earlier version) v2.0 (earlier version) v1.3 (earlier version)
  • GET STARTED
    • Quick start
      • 1. Install YugabyteDB
      • 2. Create a local cluster
      • 3. Explore YSQL
      • 4. Build an application
        • Java
        • NodeJS
        • Go
        • Python
        • Ruby
        • C#
        • PHP
        • C++
        • C
    • Introduction
    • Explore core
      • 1. Linear scalability
      • 2. Fault tolerance
      • 3. Global distribution
      • 4. Auto sharding
      • 5. Tunable reads
      • 6. Observability
  • USER GUIDES
    • Develop
      • Learn app development
        • 1. SQL vs NoSQL
        • 2. Data modeling
        • 3. Data types
        • 4. ACID transactions
        • 5. Aggregations
        • 6. Batch operations
        • 7. Date and time
        • 8. Strings and text
      • Ecosystem integrations
        • Apache Kafka
        • Apache Spark
        • JanusGraph
        • KairosDB
        • Presto
        • Metabase
      • Real-world examples
        • E-Commerce App
        • IoT Fleet Management
        • Retail Analytics
      • Explore sample applications
    • Deploy
      • Checklist
      • Manual deployment
        • 1. System configuration
        • 2. Install software
        • 3. Start YB-Masters
        • 4. Start YB-TServers
        • 5. Verify deployment
      • Kubernetes
        • Helm Chart
        • Helm configuration
        • Local SSD
      • Docker
      • Public clouds
        • Amazon Web Services
        • Google Cloud Platform
        • Microsoft Azure
      • Pivotal Cloud Foundry
      • Yugabyte Platform
        • 1. Prepare cloud environment
        • 2. Install Admin Console
        • 3. Configure Admin Console
        • 4. Configure Cloud Providers
    • Benchmark
      • Performance
      • YCSB
      • Large datasets
    • Secure
      • Security checklist
      • Authentication
      • Authorization
        • 1. RBAC Model
        • 2. Create Roles
        • 3. Grant permissions
      • TLS encryption
        • 1. Prepare nodes
        • 2. Server-server encryption
        • 3. Client-server encryption
        • 4. Connect to cluster
      • Encryption at Rest
    • Manage
      • Backup and restore
        • Backing up data
        • Restoring data
      • Data migration
        • Bulk import
        • Bulk export
      • Change cluster config
      • Upgrade deployment
      • Diagnostics reporting
      • Yugabyte Platform
        • Create universe - Multi-zone
        • Create universe - Multi-region
        • Edit universe
        • Edit config flags
        • Health checking and alerts
        • Create and edit instance tags
        • Node status and actions
        • Read replicas
        • Back up and restore
        • Upgrade universe
        • Delete universe
    • Troubleshoot
      • Troubleshooting overview
      • Cluster level issues
        • YCQL connection issues
        • YEDIS connection Issues
      • Node level issues
        • Check processes
        • Inspect logs
        • System statistics
      • Yugabyte Platform
        • Troubleshoot universes
  • REFERENCE
    • APIs
      • YSQL
        • Statements
          • ABORT
          • ALTER DATABASE
          • ALTER DOMAIN
          • ALTER TABLE
          • BEGIN
          • COMMENT
          • COMMIT
          • COPY
          • CREATE DATABASE
          • CREATE DOMAIN
          • CREATE INDEX
          • CREATE SCHEMA
          • CREATE SEQUENCE
          • CREATE TABLE
          • CREATE TABLE AS
          • CREATE TYPE
          • CREATE USER
          • CREATE VIEW
          • DEALLOCATE
          • DELETE
          • DROP DATABASE
          • DROP DOMAIN
          • DROP SEQUENCE
          • DROP TABLE
          • DROP TYPE
          • END
          • EXECUTE
          • EXPLAIN
          • GRANT
          • INSERT
          • LOCK
          • PREPARE
          • RESET
          • REVOKE
          • ROLLBACK
          • SELECT
          • SET
          • SET CONSTRAINTS
          • SET TRANSACTION
          • SHOW
          • SHOW TRANSACTION
          • TRUNCATE
          • UPDATE
        • Data types
          • Binary
          • Boolean
          • Character
          • Date-time
          • Json
          • Money
          • Numeric
          • Serial
          • UUID
        • Expressions
          • currval()
          • lastval()
          • nextval()
        • Keywords
        • Reserved Names
      • YCQL
        • Quick Start YCQL
        • ALTER KEYSPACE
        • ALTER ROLE
        • ALTER TABLE
        • CREATE INDEX
        • CREATE KEYSPACE
        • CREATE ROLE
        • CREATE TABLE
        • CREATE TYPE
        • DROP INDEX
        • DROP KEYSPACE
        • DROP ROLE
        • DROP TABLE
        • DROP TYPE
        • GRANT PERMISSION
        • GRANT ROLE
        • REVOKE PERMISSION
        • REVOKE ROLE
        • USE
        • INSERT
        • SELECT
        • UPDATE
        • DELETE
        • TRANSACTION
        • TRUNCATE
        • Simple Value
        • Subscript
        • Function Call
        • Operator Call
        • BLOB
        • BOOLEAN
        • MAP, SET, LIST
        • FROZEN
        • INET
        • Integer & Counter
        • Non-Integer
        • TEXT
        • Date & Time Types
        • UUID & TIMEUUID
        • JSONB
        • Date and time functions
    • CLIs
      • yb-ctl
      • yb-docker-ctl
      • yb-master
      • yb-tserver
      • ysqlsh
      • cqlsh
    • Sample data
      • Chinook
      • Northwind
      • PgExercises
      • SportsDB
    • Tools
      • TablePlus
  • RELEASES
    • Release history
      • v1.3.1
      • v1.3.0
      • v1.2.12
      • v1.2.11
      • v1.2.10
      • v1.2.9
      • v1.2.8
      • v1.2.6
      • v1.2.5
      • v1.2.4
  • CONCEPTS
    • Architecture
      • Design goals
      • Layered architecture
      • Basic concepts
        • Universe
        • YB-TServer
        • YB-Master
        • Acknowledgements
      • Query layer
        • Overview
      • DocDB store
        • Sharding
        • Replication
        • Persistence
        • Performance
      • DocDB transactions
        • Isolation Levels
        • Single row transactions
        • Distributed transactions
        • Transactional IO path
  • FAQ
    • Comparisons
      • CockroachDB
      • Google Cloud Spanner
      • MongoDB
      • FoundationDB
      • Amazon DynamoDB
      • Azure Cosmos DB
      • Apache Cassandra
      • Redis in-memory store
      • Apache HBase
    • Other FAQs
      • Product
      • Architecture
      • Yugabyte Platform
      • API compatibility
  • CONTRIBUTOR GUIDES
    • Get involved
  • Misc
    • YEDIS
      • Quick start
      • Develop
        • Client drivers
          • C
          • C++
          • C#
          • Go
          • Java
          • NodeJS
          • Python
      • API reference
        • APPEND
        • AUTH
        • CONFIG
        • CREATEDB
        • DELETEDB
        • LISTDB
        • SELECT
        • DEL
        • ECHO
        • EXISTS
        • EXPIRE
        • EXPIREAT
        • FLUSHALL
        • FLUSHDB
        • GET
        • GETRANGE
        • GETSET
        • HDEL
        • HEXISTS
        • HGET
        • HGETALL
        • HINCRBY
        • HKEYS
        • HLEN
        • HMGET
        • HMSET
        • HSET
        • HSTRLEN
        • HVALS
        • INCR
        • INCRBY
        • KEYS
        • MONITOR
        • PEXPIRE
        • PEXPIREAT
        • PTTL
        • ROLE
        • SADD
        • SCARD
        • RENAME
        • SET
        • SETEX
        • PSETEX
        • SETRANGE
        • SISMEMBER
        • SMEMBERS
        • SREM
        • STRLEN
        • ZRANGE
        • TSADD
        • TSCARD
        • TSGET
        • TSLASTN
        • TSRANGEBYTIME
        • TSREM
        • TSREVRANGEBYTIME
        • TTL
        • ZADD
        • ZCARD
        • ZRANGEBYSCORE
        • ZREM
        • ZREVRANGE
        • ZSCORE
        • PUBSUB
        • PUBLISH
        • SUBSCRIBE
        • UNSUBSCRIBE
        • PSUBSCRIBE
        • PUNSUBSCRIBE
> Develop >

Explore sample applications

Attention

This page documents an earlier version. Go to the latest (v2.3) version.

After creating a local cluster, follow the instructions below to run the Yugastore app.

After running Yugastore, we recommend running the IoT Fleet Management app. This app is built on top of YugabyteDB as the database (using the YCQL API), Confluent Kafka as the message broker, KSQL or Apache Spark Streaming for real-time analytics and Spring Boot as the application framework.

  • macOS
  • Linux
  • Docker
  • Kubernetes

Yugastore-java app is an end-to-end ecommerce application built using a microservices design pattern. React UI, Spring Boot app framework and YugabyteDB (both YSQL and YCQL) are used as the underlying technology stack.

1. Create cluster

Create a cluster.

$ ./bin/yb-ctl create

Clients can now connect to the YSQL API at localhost:5433 and YCQL API at localhost:9042.

2. Install Yugastore

Clone the repo.

$ git clone https://github.com/yugabyte/yugastore-java.git
$ cd yugastore-java

Create the app binaries.

$ mvn -DskipTests package

Create the app's schema in YugabyteDB.

$ cd resources
$ $YUGABYTE_HOME/bin/ysqlsh -f schema.sql
$ $YUGABYTE_HOME/bin/cqlsh -f schema.cql

Load the initial data.

$ ./dataload.sh

3. Start the app

Start the Eureka discovery service. After starting, verify that the service is running at http://localhost:8761/.

$ cd eureka-server-local/ && mvn spring-boot:run

Start the API gateway microservice.

$ cd api-gateway-microservice/ && mvn spring-boot:run

Start the products microservice.

$ cd products-microservice/ && mvn spring-boot:run

Start the checkout microservice.

$ cd checkout-microservice/ && mvn spring-boot:run

Start the UI service. After starting, browse the app at http://localhost:8080/.

$ cd react-ui/ && mvn spring-boot:run

4. Add items to the cart

Add two items to the cart as shown below.

yugastore-java checkout

Verify that your cart is now stored inside the YSQL shopping_cart table. From your YugabyteDB local cluster home, run the following.

$ ./bin/ysqlsh
postgres=# select * from shopping_cart;
 cart_key     | user_id |    asin    |       time_added        | quantity 
------------------+---------+------------+-------------------------+----------
 u1001-0001048236 | u1001   | 0001048236 | 2019-05-29T13:46:54.046 |        1
 u1001-0001048775 | u1001   | 0001048775 | 2019-05-29T13:46:56.055 |        1
(2 rows)

5. Verify the completed order

Now complete the checkout and observe the order number generated.

yugastore-java order confirmation

Verify that this order number is now in the YCQL orders table.

$ ./bin/cqlsh localhost
cqlsh> select * from cronos.orders;
order_id                             | user_id | order_details                                                                                                                                                                           | order_time              | order_total
--------------------------------------+---------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+-------------
 119b96dc-7d1a-4f2f-a1dd-36def25348e0 |       1 | Customer bought these Items:  Product: The Sherlock Holmes Audio Collection, Quantity: 1; Product: Measure for Measure: Complete & Unabridged, Quantity: 1; Order Total is : 741.95 | 2019-05-29T13:54:04.093 |      741.95

Verify that there are no active shopping carts in YSQL at this point.

postgres=# select * from shopping_cart;
cart_key | user_id | asin | time_added | quantity 
----------+---------+------+------------+----------
(0 rows)

6. Run IoT Fleet Management app

After running Yugastore, we recommend running the IoT Fleet Management app. This app is built on top of YugabyteDB as the database (using the YCQL API), Confluent Kafka as the message broker, KSQL or Apache Spark Streaming for real-time analytics and Spring Boot as the application framework.

Yugastore-java app is an end-to-end ecommerce application built using a microservices design pattern. React UI, Spring Boot app framework and YugabyteDB (both YSQL and YCQL) are used as the underlying technology stack.

1. Create cluster

Create a cluster.

$ ./bin/yb-ctl create

Clients can now connect to the YSQL API at localhost:5433 and YCQL API at localhost:9042.

2. Install Yugastore

Clone the repo.

$ git clone https://github.com/yugabyte/yugastore-java.git
$ cd yugastore-java

Create the app binaries.

$ mvn -DskipTests package

Create the app's schema in YugabyteDB.

$ cd resources
$ $YUGABYTE_HOME/bin/ysqlsh -f schema.sql
$ $YUGABYTE_HOME/bin/cqlsh -f schema.cql

Load the initial data.

$ ./dataload.sh

3. Start the app

Start the Eureka discovery service. After starting, verify that the service is running at http://localhost:8761/.

$ cd eureka-server-local/ && mvn spring-boot:run

Start the API gateway microservice.

$ cd api-gateway-microservice/ && mvn spring-boot:run

Start the products microservice.

$ cd products-microservice/ && mvn spring-boot:run

Start the checkout microservice.

$ cd checkout-microservice/ && mvn spring-boot:run

Start the UI service. After starting, browse the app at http://localhost:8080/.

$ cd react-ui/ && mvn spring-boot:run

4. Add items to the cart

Add two items to the cart as shown below.

yugastore-java checkout

Verify that your cart is now stored inside the YSQL shopping_cart table. From your YugabyteDB local cluster home, run the following.

$ ./bin/ysqlsh
postgres=# select * from shopping_cart;
 cart_key     | user_id |    asin    |       time_added        | quantity 
------------------+---------+------------+-------------------------+----------
 u1001-0001048236 | u1001   | 0001048236 | 2019-05-29T13:46:54.046 |        1
 u1001-0001048775 | u1001   | 0001048775 | 2019-05-29T13:46:56.055 |        1
(2 rows)

5. Verify the completed order

Now complete the checkout and observe the order number generated.

yugastore-java order confirmation

Verify that this order number is now in the YCQL orders table.

$ ./bin/cqlsh localhost
cqlsh> select * from cronos.orders;
order_id                             | user_id | order_details                                                                                                                                                                           | order_time              | order_total
--------------------------------------+---------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+-------------
 119b96dc-7d1a-4f2f-a1dd-36def25348e0 |       1 | Customer bought these Items:  Product: The Sherlock Holmes Audio Collection, Quantity: 1; Product: Measure for Measure: Complete & Unabridged, Quantity: 1; Order Total is : 741.95 | 2019-05-29T13:54:04.093 |      741.95

Verify that there are no active shopping carts in YSQL at this point.

postgres=# select * from shopping_cart;
cart_key | user_id | asin | time_added | quantity 
----------+---------+------+------------+----------
(0 rows)

6. Run IoT Fleet Management app

After running Yugastore, we recommend running the IoT Fleet Management app. This app is built on top of YugabyteDB as the database (using the YCQL API), Confluent Kafka as the message broker, KSQL or Apache Spark Streaming for real-time analytics and Spring Boot as the application framework.

Yugastore app is a sample ecommerce application built using a microservices design pattern. React UI, Node.js Express app framework and YugabyteDB (YCQL and YEDIS) are used as the underlying technology stack.

1. Create a cluster

Create a cluster. The YEDIS API is initialized along with cluster creation so nothing additional needs to be done.

$ ./yb-docker-ctl -rf 3 create

Clients can now connect to the YSQL API at localhost:5433, YCQL API at localhost:9042 and YEDIS API at localhost:6379.

2. Install Yugastore

$ docker run -p 3001:3001 -d --network yb-net --name yugastore yugabytedb/yugastore

You can see the Yugastore app at http://localhost:3001.

Yugastore app screenshot

3. Run a load tester

$ docker exec -it yugastore node /usr/local/yugastore/test/sample-user.js

4. Observe effects of load on YugabyteDB Admin UI

Now you can observe the effects of the read/write operations generated by the load tester by simply going to the YugabyteDB Admin UI at http://localhost:7000.

yugastore running

5. Review Yugastore architecture and code

Details of Yugastore architecture are documented here. Source code is available in the Yugastore GitHub repo.

6. Run IoT Fleet Management app

After running Yugastore, we recommend running the IoT Fleet Management app. This app is built on top of YugabyteDB as the database (using the YCQL API), Confluent Kafka as the message broker, KSQL or Apache Spark Streaming for real-time analytics and Spring Boot as the application framework.

Yugastore app is a sample ecommerce application built using a microservices design pattern. React UI, Node.js Express app framework and YugabyteDB (YCQL and YEDIS) are used as the underlying technology stack.

1. Create a cluster

Create a cluster.

$ kubectl apply -f yugabyte-statefulset.yaml

Initialize the YSQL API.

$ kubectl exec -it yb-master-0 bash --  -c "YB_ENABLED_IN_POSTGRES=1 FLAGS_pggate_master_addresses=yb-master-0.yb-masters.default.svc.cluster.local:7100,yb-master-1.yb-masters.default.svc.cluster.local:7100,yb-master-2.yb-masters.default.svc.cluster.local:7100 /home/yugabyte/postgres/bin/initdb -D /tmp/yb_pg_initdb_tmp_data_dir -U postgres"

Initialize the YEDIS API.

$ kubectl exec -it yb-master-0 /home/yugabyte/bin/yb-admin -- --master_addresses yb-master-0.yb-masters.default.svc.cluster.local:7100,yb-master-1.yb-masters.default.svc.cluster.local:7100,yb-master-2.yb-masters.default.svc.cluster.local:7100 setup_redis_table

Clients can now connect to the YSQL, YCQL and YEDIS APIs of the cluster at 5433, 9042 and 6379 ports respectively.

2. Install Yugastore

$ kubectl run yugastore --image=yugabytedb/yugastore:latest --port=3001 --command -- /usr/local/yugastore/bin/start-for-kubernetes.sh

Verify the deployment.

$ kubectl get deployments
NAME        DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
yugastore   1         1         1            1           13m

Check all the pods.

$ kubectl get pods
NAME                        READY     STATUS    RESTARTS   AGE
yb-master-0                 1/1       Running   0          7h
yb-master-1                 1/1       Running   0          7h
yb-master-2                 1/1       Running   0          7h
yb-tserver-0                1/1       Running   0          7h
yb-tserver-1                1/1       Running   0          7h
yb-tserver-2                1/1       Running   0          7h
yugastore-55d7c6965-ql95t   1/1       Running   0          13m

Note the yugastore pod ID above so that you can redirect its 3001 port to the localhost's 3001.

$ kubectl port-forward yugastore-55d7c6965-ql95t 3001

Now you can see the Yugastore app at http://localhost:3001.

Yugastore app screenshot

3. Run a load tester

You can do this as shown below.

$ kubectl exec -it yugastore-55d7c6965-ql95t node /usr/local/yugastore/test/sample-user.js

4. Observe effects of load on YugabyteDB Admin UI

Now you can observe the effects of the read/write operations generated by the load tester by simply going to the YugabyteDB Admin UI. First we have to find the Admin UI URL using the command below.

$ minikube service  yb-master-ui --url
http://192.168.99.100:31283

The above output is the Admin UI URL and visiting the Tablet Servers page there will show you the current state of the cluster.

yugastore running

5. Review Yugastore architecture and code

Details of Yugastore architecture are documented here. Source code is available in the Yugastore GitHub repo.

6. Run IoT Fleet Management app

After running Yugastore, we recommend running the IoT Fleet Management app. This app is built on top of YugabyteDB as the database (using the YCQL API), Confluent Kafka as the message broker, KSQL or Apache Spark Streaming for real-time analytics and Spring Boot as the application framework.

Ask our community
  • Slack
  • Github
  • Forum
  • StackOverflow
Yugabyte
Contact Us
Copyright © 2017-2020 Yugabyte, Inc. All rights reserved.