teleren/devto huggingface dataset:
Day 4: The three steps of creating your first cloud architecture
Tags: cloud, architecture, writing, career
Published: 2023-01-10 19:45:14

Are you a new cloud architect developing your first cloud architecture for a client?

Let me walk you through the three basic steps you'll need to design your first cloud architecture successfully.

---

## The significance of a cloud architecture

The architecture is the foundation for all cloud project planning and implementation, enabling you to spot possible issues before going live. As a result, the architecture should be properly planned and aligned with all major stakeholders.

## Step 1: Examine the surroundings

Building a cloud architecture is never a purely technical endeavor; it always exists within a business's context.

Because of this, it is critical to understand your surroundings before beginning to build an architecture. Learn about your client's business and their objectives. The non-technical requirements will give you a framework in which to work. After you've figured out the non-technical needs, you can ask about the technical requirements for the solutions.

After gathering both non-technical and technical requirements, you should understand the architecture required to solve the business challenge.

## Step 2: Create a rough draft

The next stage is to put your thoughts on paper by producing a first draft.

It is critical to visualize your ideas. Sketches can be used to discuss your ideas and solicit feedback. Most hyperscalers will have tools for drawing architectural sketches.

You don't need to have all the details right now. Instead, focus on the architecture's broad ideas and how it can solve business issues.

## Step 3: Gather feedback, iterate, and finalize

When you have completed your first sketch, you should receive feedback as soon as possible.

You can either have a short call or a larger workshop for this. During this meeting, show the stakeholder your sketch and explain your thought process. Allow them to understand how it solves their issues. Then allow them to ask questions and express concerns. If something new comes up that you have yet to consider, use it to improve your architecture.

Repeat this until all requirements have been met and all stakeholders are satisfied.

---

Creating a cloud architecture is a natural process, and feel free to seek feedback and adapt your architecture accordingly. This is the perfect time to make adjustments, and you'd rather make them now than four weeks later, when all of the servers have been deployed.
AWS Amplify and Many-to-Many Relationships: A Love-Hate Relationship
Tags: awsamplify, aws, serverless, cloudcomputing
Published: 2023-01-11 13:27:08

---
title: AWS Amplify and Many-to-Many Relationships: A Love-Hate Relationship
published: true
date: 2023-01-10 19:25:16 UTC
tags: AWSAmplify,AWS,Serverless,CloudComputing
canonical_url: https://techdevblog.io/aws-amplify-and-many-to-many-relationships-a-love-hate-relationship/
---

 ![AWS Amplify and Many-to-Many Relationships: A Love-Hate Relationship](https://techdevblog.io/content/images/2023/01/image_0-aws-amplify-and-many-to-many-relationships-a-love-hate-relationship.jpg)

[AWS Amplify](https://aws.amazon.com/amplify/) is a cloud-based development platform for building secure, scalable mobile and web applications. While it provides a number of useful features for building and deploying applications, it can be challenging to work with many-to-many relationships using [Amplify](https://aws.amazon.com/amplify/).

One of the main issues with handling many-to-many relationships in [Amplify](https://aws.amazon.com/amplify/) is that it does not natively support this type of relationship in its object-relational mapping (ORM) layer. This means that developers must find alternative ways to model and query many-to-many relationships in their applications.

One option is to use a "join table" to represent the many-to-many relationship. This involves creating a new table in the database that contains foreign keys for each of the related tables. While this approach can work, it can be cumbersome and may not scale well as the number of relationships increases.

Another option is to use [Amplify](https://aws.amazon.com/amplify/)'s GraphQL API and the `@connection` directive to define many-to-many relationships. While this has its limit, it usually allows developers to define a connection between two types in the GraphQL schema and then use the `@connection` directive to specify the relationship in the resolver. While this approach can be more efficient and flexible than using a join table, it can still be complex and may require a deep understanding of GraphQL and [Amplify](https://aws.amazon.com/amplify/)'s implementation.

One way to simplify the process of working with many-to-many relationships in [Amplify](https://aws.amazon.com/amplify/) is using a third-party library or framework that abstracts away some of the complexity. For example, the [Prisma 2](https://www.prisma.io) library provides a powerful ORM layer that makes it easy to define and query many-to-many relationships in a GraphQL API.

In conclusion, while [AWS Amplify](https://aws.amazon.com/amplify/) is a useful tool for building and deploying applications, it can be challenging to work with many-to-many relationships. Developers can use join tables or the `@connection` directive to define these relationships, but these approaches can be complex and may not scale well. A third-party library or framework can help simplify the process and provide a more robust solution for handling many-to-many relationships in [Amplify](https://aws.amazon.com/amplify/).

<!--kg-card-end: markdown-->
Install Golang using Gobrew
Tags: beginners, programming, go, tutorial
Published: 2023-01-10 19:40:29

The Go version manager’s name is gobrew, which is inspired by nodebrew.

## Install gobrew

```bash
curl -sLk https://git.io/gobrew | sh -

export PATH="$HOME/.gobrew/current/bin:$HOME/.gobrew/bin:$PATH"

export GOROOT="$HOME/.gobrew/current/go"
```

to make sure it installed properly:

```bash
which go
```

it should return something like:

```bash
/Users/username/.gobrew/current/bin/go
```

If it returns something else, then try to copy the second and third line into `~/zshrc`. Don't forget to `source ~/.zshrc`.

## Install Go

```bash
gobrew install 1.19.5 
```

## Set Go version

```bash
gobrew use 1.19.5
```

## Uninstall Go

```bash
gobrew uninstall 1.19.5
```

## List installed Go versions

```bash
gobrew ls
```

## List available Go versions

```bash
gobrew ls-remote
```
AWS + Machine Learning (SageMaker)
Tags: aws, machinelearning, beginners
Published: 2023-01-10 19:33:06

 
 
Every developer, data scientist, and seasoned practitioner can use machine learning thanks to AWS's most comprehensive and in-depth selection of machine learning services and accompanying cloud infrastructure.
 
 

This blog article will go through some of the most significant AWS machine learning services that may help you enhance customer experience, create accurate predictions, and get deeper insights from your data. With the most complete selection of artificial intelligence (AI) and machine learning (ML) services, infrastructure, and implementation tools, AWS assists you at every level of your ML adoption journey.

 
 
 

## AWS Machine Learning Services

- Through chatbots and virtual assistants, AWS streamlines self-service procedures and lowers operating expenses.
 

- To increase business efficiency and customer happiness, AWS gathers data from fragmented and unstructured sources throughout your organization.
 

- With websites that are customized for each visitor, AWS helps you increase consumer engagement and conversion—and watch your conversion rates rocket.
 

- Using AWS, customers can instantly extract text and data from virtually any document, such as loan applications and medical forms, without manual effort.

 
 

## SageMaker

- Developers and data scientists can rapidly and easily create, train, and deploy machine learning models at any scale using SageMaker, a fully-managed platform. All the obstacles that often prevent developers from using machine learning are eliminated by SageMaker.
 

- Machine learning often feels a lot harder than it should be to most developers because the process to build and train models, and then deploy them into production is too complicated and too slow. First, you need to collect and prepare your training data to discover which elements of your data set are important.
 
- The next step is choosing the framework and algorithm you'll employ. As soon as you've chosen your strategy, you need to train the model to generate predictions, which uses a lot of computing power. The model must then be fine-tuned to produce the best possible forecasts, which is frequently a time-consuming manual process.
 

- Once you have a model that has been properly trained, you must integrate it into your application and deploy it on scalable infrastructure. In order to experiment with and optimise each step of the process, this requires a lot of specialised knowledge, access to big computation and storage resources, and a lot of time. In the end, it's not surprising that most developers feel as though the whole thing is beyond their means.
 

- SageMaker removes the complexity that holds back developer success with each of these steps. SageMaker includes modules that can be used together or independently to build, train, and deploy your machine learning models.

 
 
Feel free to share your comments in the comment box 👇:
Growth Mind Development
Published: 2023-01-10 19:28:44

Today I learned that students tend to do better in school when teachers post their grade as not yet instead of failing them. It was interesting hearing about the effects of "Not yet" because growing up I only received a grade system and based on those i either passed or failed. It was definitely interesting hearing about it.
https://www.youtube.com/watch?v=hiiEeMN7vbQ
Annoyingly, I've disabled Vintage in ST for now...
Tags: vim
Published: 2023-01-10 19:15:19

How do Vim'mers deal with the frustration of _not_ being able to edit text (like the one I'm writing, here, on dev.to) everywhere else (outside of e.g. Vim) using modal editing?

I'm not really liking that, yeah, I can get the benefit from modal editing and in Sublime Text (due to e.g. Vintage) but not anywhere else without having to go way-out-there and use something like [cknadler/vim-anywhere](https://github.com/cknadler/vim-anywhere).

I feel like it might not be worth it to learn a new paradigm if I can't use it in more places.

Annoyingly, I've disabled Vintage for now. I might even consider using e.g. `micro` for text editing in my terminal.
New Stack Nextjs, Prisma, Typescript and trpc
Published: 2023-01-10 19:05:10

Building web applications can be a challenging task, but with the right tools, it can be made much easier. One such toolset is the combination of Next.js, Prisma, TypeScript, TRPC, and MySQL. Together, these technologies offer a powerful and flexible solution for building high-performance web applications.

Next.js is a popular framework for building server-rendered React applications. It provides a set of features that make it easy to build scalable and performant web apps, such as automatic code splitting, hot module replacement, and support for server-side rendering. This makes it ideal for building web apps that need to handle a lot of traffic or have a lot of dynamic content.

Prisma is an Object-Relational Mapping (ORM) tool that makes it easy to work with databases in your TypeScript code. With Prisma, you can define your database schema using a simple data definition language (DDL) and then use that schema to interact with your database using a set of generated TypeScript functions. This removes the need to write raw SQL queries and allows you to interact with your database in an object-oriented way.

TypeScript is a superset of JavaScript that adds optional static typing, making it easier to write maintainable and error-free code. It also includes features like interfaces, classes, and decorators, which can help you to write more elegant and expressive code. With the help of TypeScript, it becomes more easy to refactor the code and maintain it.

TRPC (Transport Layer Security Remote Procedure Call) is a way to make remote procedure calls to backend services over a secure connection. It is a way to send a message from the client to the server and get a response. This makes the communication over network much more secure and reliable.

Finally, MySQL is a popular open-source relational database management system. It is widely used for web and enterprise applications and it offers many features such as triggers, stored procedures, views, and more. With MySQL, you can easily store, retrieve, and manage large amounts of data.

By using these technologies together, you can build web applications that are fast, reliable, and easy to maintain. The combination of Next.js, Prisma, TypeScript, TRPC and MySQL offers a powerful and flexible solution for building high-performance web applications.

In conclusion, using these technologies together can help you create a robust web application that is easy to maintain, performs well, and is more secure and reliable. Whether you're a beginner or an experienced developer, these tools can help you create great web apps quickly and easily.
How to Set Up Elixir
Tags: elixir, beginners, programming, tutorial
Published: 2023-01-10 18:56:36

To set up Elixir, you will need to first install Erlang. Elixir is built on top of the Erlang virtual machine, so you will need to have Erlang installed to run Elixir.

To install Erlang, you can use Homebrew by running the following command in your terminal:

```bash
brew install erlang
```

Once Erlang is installed, you can install Elixir using Homebrew as well by running the following command:

```bash
brew install elixir
```

Once both Erlang and Elixir are installed, you can create a new Elixir project using the `mix` command. The `mix` command is Elixir's build tool, and it can be used to create new projects, manage dependencies, and run tests.

To create a new Elixir project, you can use the `mix new` command, followed by the name of your project. For example, if you want to create a new project called "hello_world", you can run the following command:

```bash
mix new hello_world
```

This will create a new directory called "hello_world" in your current location, and it will generate the basic file structure and configuration files for your new Elixir project.

Once your new project is set up, you can navigate to the project directory and start the Elixir interactive shell (or "REPL") by running the `iex` command:

```bash
cd hello_world
iex
```

This will start the `iex` REPL, where you can run Elixir code and interact with your project. You can start experimenting with Elixir and learning the language by typing Elixir code directly into the `iex` REPL.

For more information about installing and using Elixir, you can check out the official Elixir website at [https://elixir-lang.org/](https://elixir-lang.org/).
Estruturas de dados no JavaScript, o que são e qual sua utilidade?
Tags: javascript, beginners
Published: 2023-01-10 18:49:05

Quando criamos um programa ou sistema, buscamos torná-lo o mais funcional e útil possível para o usuário final. Independentemente da complexidade do projeto, desde um aplicativo simples que lista a quantidade de participantes para um evento até um sistema com inteligência artificial avançada, ele precisa armazenar e manipular dados. Mas como esses sistemas conseguem lidar com a quantidade enorme de informações que recebem? Isso é possível graças a estruturas de dados que são utilizadas na programação.

Imagine uma sala onde estão guardados diversos objetos e produtos, mas para acessá-los é necessário uma chave específica. As estruturas de dados em linguagens de programação funcionam de forma semelhante. Elas permitem armazenar, organizar e manipular informações de forma estruturada, assim como a chave permite acessar e modificar os objetos guardados na sala. Vamos entender mais a fundo como essas estruturas de dados funcionam e como elas são utilizadas na programação.

Algumas das estruturas de dados mais comuns no JavaScript incluem:

- Arrays (ou vetores): um conjunto ordenado de valores, que podem ser acessados através de um índice numérico.

```
let arr = [1, 2, 3, 4, 5];
console.log(arr[0]);  // imprime 1
console.log(arr[2]);  // imprime 3

```
O array acima, irá escrever no terminal os valores declarados, sendo esses [1,2,3,4,5].



- Objects (ou objetos): uma coleção de pares chave-valor, onde a chave é uma string e o valor pode ser de qualquer tipo.

```
let obj = {
  name: "John",
  age: 30,
  isStudent: false
};
console.log(obj.name);  // imprime "John"
console.log(obj.age);  // imprime 30
```
A forma de chamar um valor que foi definido no objeto, dentro do terminal console, é escrevendo sua marcação, ou etiqueta, como no caso (obj.name) que foi retornado "John".



- Maps: uma estrutura de dados semelhante aos objetos, mas que permite usar qualquer valor, incluindo funções e objetos, como chave.

```
let map = new Map([
  ['name', 'John'],
  ['age', 30],
  ['isStudent', false]
]);
map.set('name', 'Jane');
console.log(map.get('name'));  // imprime "Jane"

```
Como citado, muito parecido com o Object, mas aqui o nome foi alterado para Jane. Com issom o console.log(map.get('name')); irá imprimir o novo parâmetro declarado



- Sets: uma coleção de valores únicos, semelhante aos arrays, mas sem índices.

```
let set = new Set([1, 2, 3, 4, 5]);
console.log(set.has(3));  // imprime true
console.log(set.has(6));  // imprime false

```
Set é escolhido para situações que não se podem existir dados duplicados. Caso isso ocorra, eles serão ignorados, podendo armazenar diversos tipos de dados em sua coleção.


É importante saber escolher a estrutura de dados correta para o seu projeto, dependendo das necessidades de armazenamento e manipulação de dados. Além das estruturas mencionadas, existem outras opções como Listas ligadas, Árvores, Filas e Pilhas, entre outras, cada uma com suas próprias características e usos específicos.

Obrigado pela leitura!!!
How to start off January well
Tags: goals
Published: 2023-01-10 18:48:48

January is the most important month as it can set the tone of your year. If you still don't know how to spend your very first month in 2023, do this!

Dry yourself
There are fewer social events in January. So use this time not to drink! Keep your brain sharp.

Use this month to set 1 good habit
Researches say it takes at least 21 days to build a new habit. You have 21 days left. Here are a few good examples.

Writing 30 minutes

Studying 30 minutes

Work out for 30 minutes

Talk with your beloved ones without digital devices

Choose one of them and start today. And never break a streak.

Set up your goals People may say you have too much stuff to do. Wrong. That means people don't have clarity about goals. So spend time to find which ones you really want to achieve this year. Then set up the right priorities.

That's it! If you like this content follow @bitethecode!
Ruby Helpers 2
Published: 2023-01-10 18:46:28

To remember:
- Rails will change plurals when generating models
- Do not use convention words for other stuff, you will just confuse yourself!

New:
- Use block to have closing tags 
- Form helper: adds more stuff, including the authenticity token
- label_tag: first argument = for and second argument=content
- for inputs, each type has a different tag. First argument = name (and id), 2nd argument = value (prepopulate), 3rd hash = attributes of the element (for example to change id to a non conventional name)
- HTML default behavior is "gets", but Rails is "post"
- `find_by`: same as `where` but gives the first instance directly. Also `find` method is the same but use directly a number (for id). If the id does not exist, first method gives `nil`, but `find` gives an exception (ActiveRecord not found = 404 error in production)
- `resources :movies` = gives all 7 routes
- Default behavior can always be overwrite
- Using conventions makes everything EASIER!
Day 1 Class
Published: 2023-01-10 18:41:25

Today I make a decision about the rest of my 1H23. 

I also learned how to write my own tests and make syntax more efficient. I'm pretty basic so shortening syntax stresses me out even if it's more efficient. I just have to keep focusing on functionality over personal biases as I grow into a better developer.

**Questions:
- Why does .at method not work with active record relations with new verbs?
-
How to change your PHP version on Ubuntu 22.04
Tags: linux, php, ubuntu, howto
Published: 2023-01-10 18:25:07

### Info
This is a guide to change your PHP version through the command line on Ubuntu 22.04

### Installed versions list
To list all the installed PHP versions on your local device, use the following command : 
```bash
sudo update-alternatives --config php
```

### Change active PHP version
To change your currently used PHP version to a different version (that is installed), you can use the following command:
```bash
sudo update-alternatives --set php /usr/bin/php${version}
```
Simplification and Ruby Magic
Tags: ruby, rails, learning
Published: 2023-01-10 18:15:38

# **Intro**
Diving back into Ruby on Rails after about 6 months, it took me a little time to start to regain my comfort with the flow between route, control, action, and view. As I've re-acquainted myself with the basics of coding in Ruby, I've also started to learn the beauty of coding RESTfully. This has allowed me to start shrinking the amount of code needed, and understand how to use "Ruby Magic" to make my code simpler and more functional. 

## Simple Code
Two of my favorite code simplifications have been using a simpler resources command to generate the standard routes and route labels, and the form_with :model helper. The route helper ensures I have RESTful routes and route aliases ready to go. And the form helper capitalizes on the RESTful code, and makes further assumptions, to simplify data collection. The helper relies on RESTful routes and aliases to know to call helper methods for routes to generate the form url. And uses the object being used to identify whether it is creating new data or updating existing data. Once it has that information, the helper makes storing related attributes together in one hash simple, so that mass assignment is possible.     

## Searching for Answers
The other thing I've noticed is that learning how to simplify code, from new ways of writing a hash, to relying more on helpers and available methods has enabled me to begin to understand more code online. When looking for helpful guidance on how to finish the code, I was able to recognize when a simpler hash or a helper was being used, and why tags and information I had previously included were not needed because of the RESTful code assumption.