Giter Site home page Giter Site logo

go-scylla's Introduction

Docker pull

docker pull scylladb/scylla:5.2
docker compose up -d

Show status

After the setup is done you will see two node running on DC1

docker exec -it scylla-node1 nodetool status

Access CQl to generate some keyspace and table

docker exec -it scylla-node1 cqlsh

Create datacenter and initial table

// users = keyspace

CREATE KEYSPACE users WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy','DC1' : 3};
use users;
CREATE TABLE IF NOT EXISTS users.userData (
    id UUID PRIMARY KEY,
    name TEXT,
    email TEXT
);
describe users.userdata;

Check that datacenter is working

If the data of the tables users show that mean datacenter work

docker exec -it scylla-node2 cqlsh
describe users.userdata;

To test it with the api you need everything to be on the same network


// server image
docker run -d --net=test-scylla_web --name some-go-app go-app

// for sending api
docker run -it --name my-ubuntu-container --network test-scylla_web ubuntu:noble-20240114

// execute ubuntu
docker exec -it my-ubuntu-container bin/bash
apt update
apt install -y curl


// save user in db
curl --location 'some-go-app:5000/users_v1/register' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name":"mix1",
    "email":"[email protected]"
}'

// get users in db
curl --location 'some-go-app:5000/users_v1/get-users'

go-scylla's People

Contributors

tgrziminiar avatar

Watchers

 avatar

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.