Skip to content

Instantly share code, notes, and snippets.

View DanielHe4rt's full-sized avatar
💜
He4rt Developers Evangelist

Daniel Reis DanielHe4rt

💜
He4rt Developers Evangelist
View GitHub Profile
export const tags = [
{
slug: "backend",
name: "Backend",
description: "Backend development refers to the server-side of an application and everything that communicates between the database and the browser.",
}
];
Welcome to the "How to Write Better Apps" section.
In short, this section is a walkthrough of the best practices to improve your app performance and point out common user mistakes to avoid when working with ScyllaDB CQL.
We're also going to talk about things that you should consider while working with multiple data centers.
The first thing that you should know is that we're going to be using a ScyllaDB project called Scylla Monitoring, which provides a full dashboard to work with, displaying many metrics related to your current ScyllaDB usage in a really fancy way.
You can find graphs and monitoring tools by clicking on the monitoring button inside your cluster. But if you're using the open-source version of ScyllaDB, make sure to install it according to the monitoring repository documentation.

Introduction

Welcome back to How to Write Better Apps Section! Today we’re see how to avoid Non-Paged and Reverse CQL Reads.

In today’s agenda, we’re gonna add a new feature in our project and also going through the two gauges mentioned above.

And in the end, we’re gonna take a look in a real Scylla Monitoring Dashboard with the fixes mentioned here, ok?

Project Overview

Introduction

Welcome back to How to Write Better Apps Section!

Today we’re gonna talk about things that you need to be aware when scaling to Multi-DC with ScyllaDB.

In our agenda we’re going to talk about:

  • the importance of Consistency Level;
  • Which Policies to use in our project;
  • and giving some examples with Rust and Golang Driver

## Introduction

Welcome to the How to Write Better Apps section! Today we’re gonna talk about Filtering and Denormalization of data.

An this class, the goal is to introduce a data modeling problem, present different solutions to it, and comment on each, showing pros and cons.

Let’s rewind about our last session: Previously we did a simple modeling of a tweets and timeline query, and, at this time, we’ll focus only on the timeline feature.

Our data modeling strategy is to partition the timeline by username, and cluster it by created_at in descending order. This approach ensures that whenever we query the timeline table, we'll get the most recent tweets added to that particular timeline.

Introduction

Welcome to How to Write Better Apps Section!

Today we’re gonna be talking about “Non-Prepared Statements” and “Non-Token Aware Request” in ScyllaDB.

At this class we’re going to analyze the data modeling that will be used throughout the entire section and show you how to use the Scylla Monitoring Dashboard to identify problems related to Non-Prepared Statements queries.

Ok, so let’s say that we’re building a twitter clone… What would be our MVP in this case?

@DanielHe4rt
DanielHe4rt / install-driver.sh
Created June 5, 2024 17:50
ScyllaDB PHP Driver in a fresh Ubuntu 22.04 Docker Image.
#!/bin/bash
# Tested in a 22.04 Ubuntu Docker VM
apt-get update -y \
&& apt-get upgrade -y \
&& apt-get install -y \
autoconf \
nano \
pkg-config \
sudo \
@DanielHe4rt
DanielHe4rt / teste-foda.md
Last active July 21, 2024 00:11
Teste Técnico: Crie seu Discord!

Teste Tecnico: Desenvolvimento de uma Aplicação de Chat em Tempo Real com PHP e Laravel (ou qualquer outra lang)

Introdução

Neste desafio, você será responsável por desenvolver uma aplicação de chat em tempo real utilizando PHP e o framework Laravel. A aplicação deve oferecer funcionalidades básicas similares às encontradas em plataformas de chat como o Discord. O foco principal é a criação de um backend robusto e escalável, utilizando as abstrações e boas práticas do Laravel.

Requisitos do Projeto

Funcionalidades Principais

@DanielHe4rt
DanielHe4rt / ACID.md
Created July 3, 2023 18:15
ACID Database Studies
  • Acronym
    • Atomicity
      • One operation per time, independent on which one (INSERT, UPDATE, DELETE etc), preventing any error to be persisted. Basically: every piece of your query should be ok "atomically speaking" to be considered a successful operation.
      • If any part of the operation fails, it will roll everything back.
    • Consistency
      • Let you only write data that is predefined previously. Like a table modeling with specifics data types, constraints, cascades, indexes or any other modeled clause.
    • Isolation
  • Each operation per time without interfere in other operations;
@DanielHe4rt
DanielHe4rt / rust-uuid.rs
Last active April 19, 2023 16:08
Why this doesn't work plz I just want a struct to work in my example
// on the second example i know that i need to use ValueList (from scylla) but it stills crashes on Uuid problem.
use anyhow::Result;
use chrono::{NaiveDate, Utc};
use scylla::{FromRow, Session, SessionBuilder, ValueList};
use serde::{Deserialize, Serialize};
use std::time::Duration as TimeoutDuration;
use uuid::Uuid;
#[derive(Debug)]