teleren/devto huggingface dataset:
10 Benefits of using a Service Mesh
Tags: devops, kubernetes, devjournal, programming
Published: 2023-03-20 02:31:00

A service mesh is a layer of infrastructure that manages communication between services in a distributed system. 

Some of the benefits of using a service mesh include 🧵👇

## 1. Improved reliability: 
A service mesh provides features such as automatic retries and circuit breakers, allowing services to continue functioning even if one or more services fail.


## 2. Enhanced observability: 
A service mesh provides detailed information about the communication between services, allowing you to monitor and observe the behaviour of your system more effectively.


## 3. Better security:
A service mesh can provide features such as encryption and authentication, helping to protect the communication between services from external threats.


## 4. Reduced complexity: 
A service mesh abstracts the complexity of communication between services, allowing you to focus on the business logic of your services rather than the underlying infrastructure.


## 5. Increased scalability: 
A service mesh can help to improve the scalability of your system by routing traffic between services in a way that optimizes performance and availability.


## 6. Improved performance: 
A service mesh can provide features such as load balancing and traffic routing, allowing you to optimize the performance of your system.

## 7. Simplified testing: 
A service mesh can make it easier to test and validate the performance and reliability of your system by providing a consistent interface for communication between services.


## 8. Enhanced collaboration: 
A service mesh can make it easier for teams to work together and share information about the communication between services.


## 9. Reduced mean time to resolution: 
A service mesh can help reduce the time it takes to identify and resolve performance issues and errors by providing detailed information about the communication between services.


## 10. Improved customer experience: 
By providing a more reliable and efficient way for services to communicate, a service mesh can help improve the quality and reliability of the services that your customers rely on.


![Benefits of service mesh](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/83v9fxini1qgt9ankywz.png)


Overall, a service mesh can provide many benefits, including improved reliability, enhanced security, improved observability, and better support for microservices.

Thanks for reading this.

If you have an idea and want to build your product around it, schedule a call with [me](https://calendly.com/pragyanatvade).

If you want to learn more about DevOps and Backend space, [follow me](https://dev.to/pragyanatvade).

If you want to connect, reach out to me on [Twitter](https://twitter.com/pragyanatvade) and [LinkedIn](https://www.linkedin.com/in/pragyanatvade/).
Journal entry 1 - The making of something magical
Tags: project2, hw10
Published: 2023-03-20 01:52:13

As we embark on our project to build a microfrontend, we are excited to share our initial thoughts and ideas with you in this first article of our series. In this article, we will be focusing on the scope of the project and our initial conception of how we will approach it.

Firstly, let us introduce ourselves. We are a group of college students working collaboratively on this project, and we are enthusiastic about learning and experimenting with microfrontend architecture.

To begin with, we have identified the main goal of our project, which is to create a searchable interface using web components that are delivered via Vercel endpoints. We plan to create at least three web components that work together to deliver the user experience we are aiming for.

As a part of our initial conception, we have identified the two UI options we will be working with - the Badge UI and the Collapse UI. We will be using the Badge UI as a dashboard for a high-level search, where we will be showing cards as "badges." The Collapse UI will be used to show details in a collapsed fieldset, which will expand when the user clicks on it. For this, we will be using either the summary/details relationship or a navigation-collapse component.

We have also created an API specification in JSON format, which will be loaded from an endpoint (/api/search). To enable users to interactively search, we will include a search input and a button to execute the search. Once the user hits the search button, we will use a .map method to update the search results visually.

As we move forward with the project, we anticipate needing specific properties for our web components. For example, the Badge UI will need an image and a title, while the Collapse UI will require a title, a summary, and a detail field. We will also need data to come from the backend to make our components work, which will be delivered via our custom API endpoint.

To give you a better idea of our initial conception, we have included a screenshot of our API specification in JSON format. This will show you how we plan to name the elements involved and what properties we anticipate needing.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dnirnkce1j4hps8g8c08.png)

We will also be using concepts from our homework, such as importing and using @lrnwebcomponents/simple-icon and @lrnwebcomponents/simple-icon/lib/simple-icons to get access to an icon library. We will be using these icons to enhance the user interface and improve the overall user experience.

In conclusion, our first article in this series has focused on the scope of our microfrontend project and our initial conception of how we will approach it. We hope that by sharing our thoughts and ideas with you, we have given you a glimpse into the process of building a microfrontend. In the upcoming articles, we will dive deeper into the technical details and share our progress as we work towards our goal of building a functional and visually appealing microfrontend.
What!? ReactJS isn’t for SPAs anymore?
Tags: webdev, javascript, react, frontend
Published: 2023-03-20 01:47:15

ReactJS has been a popular choice for building single-page applications (SPAs) for years. However, with the release of new documentation, they stripped away almost all mention of SPAs to some people's confusion. Instead, they are pushing the broader idea of “React Architecture.” But what is “React Architecture”? To summarize it:

> React architecture is flexible and does not enforce any particular pattern to write a complex application. Developers are free to choose the design pattern of their choice. React architecture is built on a solid foundation and is simple, flexible, and extensible.

In other words, React is a library that can be used to build complex applications with the design pattern of your choice. The primary piece to this change is React Server Components, which were teased a couple of years ago. React Server Components are components that can be rendered on both the server and the client. They allow developers to build applications that span both sides of the application, combining the rich interactivity of client-side apps with the improved performance of traditional server rendering. The new documentation now reflects React as a library to use on both the client and server sides. It pushes single-page apps as a footnote and now recommends using a framework like Next.js that incorporates React Server Components instead of create-react-app.

The React team has admitted that they need to do a better job of adequately communicating the initiatives they have going on. We were teased with React Server Components and other features like Suspense a couple of years ago, but there was mostly radio silence after that until the new docs were released, making it appear like React took a hard right turn off the SPAs highway. But React has been silently heading in this new "direction" for a while now; it just wasn't noticeable.

Is React no longer for SPAs? NO, it’s not only for SPAs but also for the server. The React team wants you to start considering React in that way so you can get the best performance possible for your users by first considering frameworks that use the newer features of React to their fullest extent. But in the end, the beauty of “React Architecture” is that you can choose how to use React.
Week 10: Scoping out the Project
Published: 2023-03-20 01:26:28

The following was written by my partner, I assisted and drove the coding part:

Writing the 1st article in a series about the scope of what your going to be building
from base card to new project we will be adapting the information to the new ones. this could include individual data for the new cards in the search engine. these individual cards also need to have the scalibility to be individually manipulated. we're also going to need to implement the search engine with a drop down menu that will help break down exatly what the user is searching for so that not everything is displayed and only the cards in that category.

Include images of how you are conceiving the API for the elements involved and the names
we are unsure of how to respond to this 

What properties do you think you'll need
badge name, badge icon, badge color accent , badge creator, badge category 

What sort of information will need to come from the backend to make this work?
need information like what to search for in the frontend

Either using a screen cast, taking screen shots, links to your code, show how you'll apply concepts from the Homework
https://i.imgur.com/DIyNwrA.png
https://i.imgur.com/JEkxfBR.png

Relate it to what you'll have to do in order to pull this off for Project 2
the card from p1 to p2 will need to be its own individual property with enough customizability that it can be individually edited while maintaining its shape along with the ability to individually be brought up/taken away from the search criteria

Article one is a focus on scope and the activity we did in class. What is the project, what will things be named, how will you initially conceive of attacking the problem
the project is the search menu with the cards. things will be named generally enough so that we can call a group of cards. an example of this could be badges_energydrinks, badges_juices, and these will all be individualized but within the same category.
Goodbye Create React App
Published: 2023-03-20 00:09:38

React is a popular JavaScript library that helps you build user interfaces for websites and apps. When starting a new project with React, you may wonder if you should use a framework or not. React just released its new documentation [React Docs](https://react.dev/) and the creators of React recommend using a framework, and in this article, we'll see why.

### Framework

Frameworks are pre-built sets of tools and features that can help you build websites and apps faster and more efficiently. They provide features like routing (helping you move between different parts of your site or app), data fetching (helping you get data from a server), and generating HTML (helping your site or app load faster).

### The Problem
While you can use React without a framework, building a project fully with React can lead to problems as your project grows. As you add more features, your JavaScript code can become larger, leading to slower load times. You may also need to figure out how to split code for every route individually or encounter server-client network waterfalls that make your app feel very slow. This is why Svelte has SvelteKit, Vue has Nuxt, and other frameworks exist to solve these problems.

### The Solution
React frameworks solve these problems by default, with no extra work from your side. They let you start with a lean codebase and scale your app with your needs. Each React framework has a community, so finding answers to questions and upgrading tooling is easier. Frameworks also give structure to your code, helping you and others retain context and skills between different projects.

### What if I still want to use CRA?
If you have unusual constraints that aren't served well by existing frameworks or you simply prefer to create your own custom setup, you can still use React without a framework. You can grab `react` and `react-dom` from npm, set up your custom build process with a bundler like [Vite](https://vitejs.dev/) or [Parcel](https://parceljs.org/), and add other tools as you need them for routing, static generation or server-side rendering, and more.

### Conclution
In summary, while it's possible to use React without a framework, the creators of React recommend using a framework to solve common problems and make building your app or website faster and more efficient. Its time to say Goodbye to `create-react-app` and start using Production-grade React frameworks like Next.js, Remix, Gatsby or Expo (for native apps).
Deploy PocketBase in 30 Seconds
Tags: pocketbase, backend, baas, deploy
Published: 2023-03-20 00:42:44

Just wanted to share this amazing tool called [pockethost.io](https://pockethost.io/). It allows you to get your PocketBase instance up & running quickly without having to fiddle with Docker or provision your server. You just pick a unique name for your app and you're good to go with the click of a button 🚀

Big shout out to [Ben](https://github.com/benallfree), [Oscar](https://github.com/shaparder), [Lucas](https://github.com/Ianmello10), and [Zach](https://github.com/brewhousedigital) 💙 

GitHub: [github.com/pockethost](https://github.com/benallfree/pockethost)
Async-first communication (Comunicação assíncrona)
Tags: communication, javascript, techleaders
Published: 2023-03-20 00:36:33

Olá, hoje resolvi escrever sobre comunicação assíncrona, uma excelente ferramenta que melhorará a comunicação do seu time, mas antes de falarmos dela falaremos da comunicação síncrona.

_**O que é comunicação síncrona?**_

Aquela conversa frente a frente, quando nos reunimos com pessoas em uma sala física ou virtual para reunião, ou então uma conversa por telefone esses são exemplos de comunicação síncrona. Quando você e a pessoa com quem se fala estão sincronizados naquele momento.

Imagine um cenário que você precisa conversar com várias pessoas ao longo do dia para resolver demandas importantes. Nesse modelo provavelmente você encontrará pessoalmente ou virtualmente com cada um deles, gerando assim várias reuniões em sua agenda, isso de alguma forma influenciará na sua produtividade ao fim do dia.

_**O que é Comunicação assíncrona ou Async-first?**_

Async-first communication é uma abordagem de comunicação que prioriza a troca de mensagens e informações de forma assíncrona, em vez de depender exclusivamente de interações síncronas em tempo real.

Em sistemas que utilizam uma abordagem async-first para comunicação, as mensagens são geralmente enviadas por meio de filas ou sistemas de mensagens, permitindo que os destinatários processem as mensagens de forma assíncrona, quando for conveniente e estiver disponível para fazê-lo.

Essa abordagem é particularmente útil em sistemas distribuídos e em nuvem, onde as interações entre componentes do sistema podem ser imprevisíveis e podem ocorrer atrasos na comunicação. Além disso, sistemas que utilizam async-first communication são geralmente mais resilientes por conseguirem lidar melhor com falhas e erros de comunicação.

Embora a comunicação assíncrona possa exigir uma infraestrutura de comunicação mais complexa e possa ser menos intuitiva para os desenvolvedores, que estão acostumados com abordagens síncronas, os benefícios da abordagem async-first, incluindo escalabilidade, eficiência e resiliência, podem valer a pena o esforço adicional necessário para implementá-la.

Espero que esse artigo tenha te ajudado a entender essa poderosa ferramenta de comunicação.

Até mais!
Setup Spring Boot with JPA and MySQL
Tags: spring, jpa, mysql
Published: 2023-03-21 11:10:56

---
title: Setup Spring Boot with JPA and MySQL
published: true
date: 2023-03-20 00:00:00 UTC
tags: spring,jpa,mysql
canonical_url: https://blog.robertoconterosito.it/posts/setup-spring-boot-with-jpa/
---

_Welcome back to my dev notes!_

Few things that I’ve to remember next time I need to setup a Spring Boot project with JPA and MySQL:

- Add the following dependencies to your `pom.xml`:

```
<dependency>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
 <groupId>mysql</groupId>
 <artifactId>mysql-connector-java</artifactId>
</dependency>

```

- Add the following properties to your `application.properties`:

```
spring.datasource.url=jdbc:mysql://localhost:3306/db_name
spring.datasource.username=root
spring.datasource.password=root
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true

```

- Create your model using `@Entity` and `@Id` annotations:

```
@Entity
public class User {
 @Id
 @GeneratedValue(strategy = GenerationType.IDENTITY)
 private Long id;
 private String name;
 private String email;
 private String password;
 // getters and setters
}

```

- Create your repository extending `JpaRepository` adding `@Repository` annotation:

```
@Repository
public interface UserRepository extends JpaRepository<User, Long> {}

```

Now you are ready to `@Autowired` your repository and use it in your services/controllers.

That’s all for today, see you next time!
Week 9: record editing and other PR polishing
Tags: opensource
Published: 2023-03-19 23:31:14

## Overview 
Hello Hello, this week was pretty productive and I got some good stuff delivered. The first thing I was working on was finishing with PR that I created last week, which was about the integration of the DNS record creation workflow into the existing UI. The second thing was a record editing integration and the last small thing was disabling actions if the record is inactive. 

## Polishing a big PR 
It took some time and about 12 extra commits to target all suggestions on the PR I created the last week and eventually it got merged (very good). 

https://github.com/DevelopingSpace/starchart/pull/324

## Making records editable 
Since we already had the DNS records workflow function to update records it was a good time to connect it with the existing UI for record creation, just by pre-populating values of the record that the user wants to edit. I cannot say that I faced any major challenges during development time. The biggest one was probably to keep my changes up-to-date with what was going on in the `main` branch since some of my peers worked on the adjacent part of the system. I also had a little confusion with David, when I did the same thing in my PR when tried to adjust my changes to the new vocabulary of the project. I ended up closing David's PR and just taking some ideas of his PR in mine (sorry David). 

https://github.com/DevelopingSpace/starchart/pull/369

## Another small one
After the previous PR got merged I found that I was tagged in one small issue in GitHub, which was about taking away from users' ability to do any actions on records if they are not active. It was a quick 14 lines of code PR that are almost merged with no problem (I just made a typo in the error message, but everything else is good). 

https://github.com/DevelopingSpace/starchart/pull/383

## The next week
The next week I would like to work on making a server-side validation for records creation and editing that will return users with meaningful error messages for specific fields, where their provided values didn't pass validation. After that it would probably be good to make some layouts for the admin page, it will probably boost brainstorming from server-side people on how it should be implemented on their side. 

## Some afterthoughts 
Even tho during almost the whole week (from the last Sunday to Friday) I was having a cold and was feeling really 💩 I was still more productive than the week ago because I was able to maintain more control over what I was working on by not wasting a lot of time and attention for social media. My war with myself for my attention is still going and I can already see the results of the first battles won. Peace ✌️
Scheduling Windows Notifications from Rust
Tags: tauri, rust, windows
Published: 2023-03-19 23:27:36

The [windows crate](https://crates.io/crates/windows) exposes the whole WinRT API surface in Rust and makes it quite easy to send native Windows notifications. One particular handy feature is scheduling notifications for the future, that Windows will deliver even when your app is closed: `ScheduledToastNotification::CreateScheduledToastNotification` .

One little sticking point is that it requires a `Foundation::DateTime` to specify the start time, and there don't seem to be any helpers to create one from a `chrono` or any native Rust date struct. I was able to find in [the documentation](https://learn.microsoft.com/en-us/uwp/api/windows.foundation.datetime.universaltime):

> A 64-bit signed integer that represents a point in time as the number of 100-nanosecond intervals prior to or after midnight on January 1, 1601 (according to the Gregorian Calendar).

So the job is to figure out how many 100ns intervals are between your desired time and the WinRT epoch. Then create a `DateTime` from scratch, passing in this tick count to the `UniversalTime` property. The full demonstration code is below:

```rust
use chrono::{Local, NaiveDateTime, Utc, Duration, TimeZone};
use windows::Foundation::DateTime;
use windows::UI::Notifications::ScheduledToastNotification;
use windows::{Data::Xml::Dom::XmlDocument, UI::Notifications::ToastNotificationManager};

use windows::core::{Result, HSTRING};

fn main() {
    let app_id = "my.app"; // AUMID
    let toast_notifier = ToastNotificationManager::CreateToastNotifierWithId(&HSTRING::from(app_id)).unwrap();

    let toast_xml = create_toast_xml().unwrap();

    let local_time_string = "2023-03-19T16:01:27";
    let winrt_start_time = local_time_to_win_datetime(local_time_string);

    let scheduled_notification = ScheduledToastNotification::CreateScheduledToastNotification(&toast_xml, winrt_start_time).unwrap();
    toast_notifier.AddToSchedule(&scheduled_notification).unwrap();
}

fn create_toast_xml() -> Result<XmlDocument> {
    let toast_xml = XmlDocument::new()?;
    toast_xml.LoadXml(&HSTRING::from("<toast>
        <visual>
            <binding template=\"ToastText01\">
                <text>Testing</text>
            </binding>
        </visual>
    </toast>"))?;

    Ok(toast_xml)
}

fn local_time_to_win_datetime(local_date_time: &str) -> DateTime {
    // First parse the time into a timezone-agnostic local time.
    let naive_time: NaiveDateTime = local_date_time.parse().unwrap();

    // Convert the naive local time to the system time zone, preferring earlier if ambiguous.
    // If there was no local time there, go back an hour and try again.
    let date_time = Local.from_local_datetime(&naive_time)
        .earliest()
        .unwrap_or_else(|| Local.from_local_datetime(&naive_time.checked_sub_signed(Duration::hours(1)).unwrap()).earliest().unwrap());
    
    let winrt_epoch = Utc.with_ymd_and_hms(1601, 1, 1, 0, 0, 0).unwrap();

    let microsecond_timestamp = date_time.timestamp_micros() - winrt_epoch.timestamp_micros();

    DateTime {
        UniversalTime: microsecond_timestamp * 10
    }
}
```
Finally decided on the pricing for my new product
Published: 2023-03-19 23:15:43

Hello everyone! We are revealing the pricing for CodeSmash, our new No Code platform! If you want more info, feel free to check it out at https://codesmash.studio

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fbf3lmaxdkty9w8778n5.jpg)