Nosql Columnar Cassandra en Docker | Jose Luis Bugarin
|En la guía en vídeo te muestro como poder levantar la imagen de cassandra en docker, conectarte a la consola cqlsh, crear un key space, insertar registros, realizar querys soportadas y como se diferencia de una base de datos relacional.
Cassandra en contenedor docker | Jose Luis Bugarin from Jose Luis Bugarin on Vimeo.
*****
docker run –name ilucassan –network ilunet -d cassandra:latest
docker run -it –network ilunet –rm cassandra cqlsh ilucassan
CREATE KEYSPACE ilutest
WITH REPLICATION = {
‘class’ : ‘SimpleStrategy’,
‘replication_factor’ : 1
};
use ilutest
CREATE TABLE scores(name TEXT, game TEXT, score BIGINT, PRIMARY KEY(name,game));
INSERT INTO scores (name, game, score) VALUES (‘Buga’,’Pacman’,1000);
INSERT INTO scores (name, game, score) VALUES (‘Buga’,’Clash’,10000);
INSERT INTO scores (name, game, score) VALUES (‘Buga’,’Mario Bros’,1200);
INSERT INTO scores (name, game, score) VALUES (‘Borrego’,’Pacman’,1003);
INSERT INTO scores (name, game, score) VALUES (‘Borrego’,’Clash’,10030);
INSERT INTO scores (name, game, score) VALUES (‘Borrego’,’Mario Bros’,1230);
SELECT * FROM scores WHERE name=’Buga’ ;
SELECT * FROM scores WHERE name=’Borrego’;
select count(*) from scores;
SELECT * FROM scores WHERE name=’Buga’ order by (score DESC);
SELECT * FROM scores WHERE game=’Pacman’;
*****