teleren/devto huggingface dataset:
Event Sourcing
Tags: beginners, tutorial, eventsourcing, eventdriven
Published: 2023-01-01 11:22:05

As a learner, many of us are confused between [Event Driven Architecture](https://dev.to/pragyasapkota/event-driven-architecture-3cod) and Event Sourcing. We have already discussed the former here and this article is especially for Event Sourcing.

## What is Event Sourcing?

For the formal definition, we can say that event sourcing is a special arrangement to store data as events in an append-only log. However, it doesn’t limit there but keeps the context of the events as well. It lets you know if and why an invoice was sent from a single data piece. This means that the append-only store is a replacement for storing the current data in a domain. The store is a system of record that can be used to unfold the domain objects.

You can simplify the work in complex domains because, in event-sourcing, there is no need to synchronize the data model and the business model but still have a great improvement in performance, scalability, and responsiveness. To top it off, the system can have transactional data with consistency while the full audit trails are maintained, and the history is open for enabling compensating actions at any time.

## What is different from Event-Driven Architecture?

The [event-driven architecture](https://dev.to/pragyasapkota/event-driven-architecture-3cod) uses events to maintain communication within the system where the sections are unaware of each other. Likewise, event sourcing uses the events as a state which is a different approach to storing data. To note, event sourcing is one of the patterns for implementing [EDA](https://dev.to/pragyasapkota/event-driven-architecture-3cod) in your system if your use case requires it.

## Advantages of Event Sourcing

- Flexible — can store any kind of message
- Real-time data reporting is well accomplished in event sourcing
- Audit logs for high compliance systems can also be easily achieved
- Fail-safety is good — you can reconstruct data from the event store

## Disadvantages of Event Sourcing

- Each event will have an individual payload
- Requires complex network infrastructure
- Need to have a separate way to control the message formats. E.g., Schema registry.

{% embed https://github.com/pragyaasapkota/System-Design-Concepts %}

**_I hope this article was helpful to you._**

**_Please don’t forget to follow me!!!_**

**_Any kind of feedback or comment is welcome!!!_**

**_Thank you for your time and support!!!!_**

**_Keep Reading!! Keep Learning!!!_**
Build a Bot with ZettaBlock GraphQL API
Tags: api, zettablock, javascript, telegrambot
Published: 2023-01-01 11:19:49

1. I created a SQL on the ZettaBlock platform.
2. Creating a Graphql query
3. Started with the telegram bot.

The left side highlights the data sources and tables available.

![data sources and tables](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/suzpwfilj8x0w4h57h8r.png)

So I started by setting up a new telegram Bot by going to BotFather and following some simple commands mentioned in the below ss.

![tele bot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f0z418zs3299f3rrd18t.png)

After that I explored the zettablock space for an hour of how things work.

So I executed the steps in this order 

1. Made a Data Query

![data query](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nhoymlln2hvxs9r1as06.png)

2. I created an SQL Query to fetch solana tokens on the mainnet.

```
SELECT
  "name",
  "symbol",
  "decimals",
  "token_authority",
  "supply",
  "type",
  "address"
FROM
  solana_mainnet.token_metadata
LIMIT
  20 
```

3. After this I created my API to query the data.

Indexed the data by selecting the name, symbol and supply field

![Indexing the data](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iapgtcs4h50kb134oapv.png)

4. Got the API key and now opened VS Code.

Initialised the project by installing node-telegram-bot api package and dotenv

`https://github.com/yagop/node-telegram-bot-api`

5. Created an index.js script for the bot to fetch the solana tokens metadata Live.

Wrote a simple graphql query to query the data

```
		data: {
			query: `
				{
					records(symbol: 
                                         "${symbol}", limit: 1 )
					{
						name
						symbol
						address
						supply
						type
						token_authority
					}
				}
			`,
		},
```

and then passed it to the bot as replymsg for when user passes the symbol of the token as an argument.

```
    const replyMsg = `
    🪙 SOL Token Data:
    - Solana Mainnet Token Address: ${data.address}
	- Name: ${data.name}
    - Token: ${data.symbol}
		
     `
     bot.sendMessage(chatId, replyMsg)
```

6. Opened the telegram bot and It worked ! hurray and that's how an awesome bot was made.


![Final work](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/csd6qmtvdmz9vlj5o5ej.png)
Web Development 101: A Simple Guide for Beginners
Published: 2023-01-01 10:42:48

Have you ever visited a website and thought to yourself, "I wish I could create something like this"? Well, with web development, you can!

But what exactly is web development? Simply put, web development is the process of creating and maintaining websites. It involves a combination of coding languages and design skills to bring a website to life.

Now, you might be wondering, "That sounds complicated. How do I get started?" Don't worry, it's not as difficult as you might think. Here are some basic concepts to help you understand the world of web development:

- **HTML**: HTML stands for HyperText Markup Language, and it's the foundation of all websites. HTML is used to structure and organize content on a webpage, such as text, images, and links.
- **CSS**: CSS, or Cascading Style Sheets, is used to style and format HTML content. With CSS, you can control things like font size, color, and layout of your webpage.
- **JavaScript**: JavaScript is a programming language that allows you to add interactivity to your website. With JavaScript, you can create things like pop-up windows, animations, and games.
- **Responsive design**: In today's world, people access the internet from a variety of devices, such as phones, tablets, and computers. Responsive design is a technique used to ensure that a website looks and functions properly on all devices.
- **Web hosting**: In order for your website to be accessible to the world, it needs to be stored on a server. This is where web hosting comes in. A web hosting provider stores your website on a server and makes it available to be viewed on the internet.

So there you have it! These are just a few basic concepts to get you started in the world of web development. With some practice and determination, you can create your own beautiful and functional websites. Happy coding!
5 Reasons Why Every Web Developer Should Build a Progressive Web App
Tags: webdev, javascript, programming, css
Published: 2023-01-01 10:34:53

Progressive web apps (**PWAs**) are revolutionizing the way we think about web development. They combine the best of both worlds - the accessibility and reach of the web with the performance and features of a native app. If you're a web developer, here are five reasons why you should consider building a PWA:

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

**1) Improved User Experience:** PWAs provide a seamless and engaging user experience, with features like offline support, push notifications, and fast loading times. These features make PWAs feel more like native apps, which can lead to increased user satisfaction and retention.

**2) Enhanced Performance:** PWAs are designed to be fast and efficient, which means they can load quickly on any device and in any network conditions. This can be especially beneficial for users with slow internet connections or for businesses targeting customers in developing countries.

**3) Increased Reach:** Unlike native apps, which are limited to specific app stores, PWAs can be accessed from any device with a web browser. This means your app has the potential to reach a much larger audience, without the need for users to download and install anything.

**4) Easy Maintenance:** Because PWAs are built using web technologies, they are easier to maintain than native apps. You can easily make updates and changes to your PWA, which will be automatically reflected for all users.

**5) Cost-Effective:** Building a PWA can be a cost-effective alternative to developing a native app. It can also save you time and resources, as you won't need to worry about creating separate versions for different operating systems.

To sum up, creating a progressive web app can offer a lot of advantages for both web developers and users. These apps offer better performance, a better user experience, and a wider audience, which is why they are gaining popularity in the field of web development.
Search & Save to list Button only with HTML CSS with awesome gradients
Tags: codepen, html, css, javascript
Published: 2023-01-01 10:24:00

<h1>Search &amp; Save list Button in html css with awesome gradient background, borders &amp; texts</h1>

{% codepen https://codepen.io/Amiru-Weerathunga/pen/xxWWyKg %}
Utilizing Chat GPT as a Web Developer
Tags: webdev, javascript, programming, productivity
Published: 2023-01-01 10:15:35


## 📧 Creating email templates & other boilder plates
In our app we do send a lot of **mail notifications** to the users and creating a template is hell of a work. Also we can get **HTML Email** template. 

The same can be used to create UI friendly texts all over the web pages

![Creating Email Templates](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7tpoy0cvbj24if8dzv8p.png)

## 🔡 Explaning stuff like regexes.
I have used it many times, never really got to sit down and leart properly. I have to do it soon. Often chat gpt shines when explaining something.

### Forming Regex 
![Forming Regex](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j3z9kzgi5bc0q6ftluxt.png)

### Explaining Regex
![Explaining Regex](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/suor737vmsvb56gms4h6.png)

## 📜 Getting documentation
I always do docs first then stackoverflow which really helps in the learning.

![Getting documentation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k3uqz2lkcnlshrsuyoq0.png)

_Peace 🕊_


---

If you are here it means you may have enjoyed reading this blog. Just follow me @shrihari which will motivate to write more.

You can make a drink [Buttermilk 🥛](https://www.buymeacoffee.com/shriharimohan). Small support comes a long way!

Subscribe If you want to receive these blogs in your mail from @[Medium](https://medium.com/@shriharimohan) for free!

## Try Our new product for free!
[DocsAI](https://docsai.app/) - Create AI support agents with your documents in the most affordable price, starts at **0$**. Don't need a bot , but need ai help on your docs just upload and start chating !

Using for a company ? [Check out our pricing](https://docsai.app/pricing) Just contact me for personalized pricing !

![docsAi](https://firebasestorage.googleapis.com/v0/b/shrihari-personal-storage.appspot.com/o/banner-docs-jpeg.jpeg?alt=media&token=45c47666-de2a-4e02-8881-beb6e43ce581)

##More Free Articles from me
{% embed https://dev.to/shrihari/oauth-for-beginners-and-key-terms-1plo %}

{% embed https://dev.to/shrihari/navbar-with-background-blur-aesthetic-look-in-2-lines-of-code--4kp6 %}

{% embed https://dev.to/shrihari/why-array-index-starts-with-0-a-pointers-magic--j53 %}
How to create sustainable new year resolutions
Tags: webdev, productivity, career, beginners
Published: 2023-01-01 09:42:02

## 1. Think on paper
  Write down what you want to achieve 

## 2. Ask yourself
What I liked about last year? What I didn’t like about last year? How can I improve it? Where do I see myself in 10 years from now? How can I make relevant goals for my future?

## 3. Write the goals by 6 sections, health, relation, career, intellectual, spiritual, and personal.
Make the goals SMART, abbreviations for specific, measurable, achievable, relevant and time bound.Let say I want to improve my relationships.
* **Weak Goal Example**: I’m going to improve my relationships.
* **SMART Goal Example**:
* Specific: I will develop my relationships with David, Sarah, and Mom.
* Measurable: I will call each of these people twice per week.
Achievable: I talk to these people regularly, and we always say how it’d be nice to talk more.
* Relevant: I want to deepen my social ties, feel more loved and supported in my life, and support those I love.
* Time-bound: I will stick to this plan for 3 months, then re-evaluate and plan my next steps.
* **SMART Goal Example Summary**: 
I will call David, Sarah, and Mum twice per week for 3 months to develop my relationships with them.

## 4.Prioritize- in each column, the one which will bring you the most result should be number 1 and accordingly do this to each of the goals.However, this doesn’t apply to habits or lifestyle changes. You can make a different column for habits.

## 5. Eliminate- keep only the 20% goals which will bring you 80% of results.

## 6. Know your purpose behind choosing that specific goal.
## 7. Break the list into steps and arrange those steps in a quarterly and monthly list.

## 8. Analyze the problems, solutions, strategy etc.
## 9. Read this list every day and honestly give yourself marks.

If you’ve done all the steps, I mentioned then there you have, an effective and achievable new year resolution.
CSS Variables end to end
Tags: html, css, javascript, webdev
Published: 2023-01-01 09:33:08

-> var() used to insert CSS variables.
-> we can create local and global variables.
-> CSS variables can have access to DOM.
-> We can change variables with javascript.
-> We can change local and global variables based on media queries.
-> Good Example: Creating variables for colors used across application. 
-> Syntax: var(--var_name, default_value);
-> variable name must starts with (--) dash dash.
-> Local variables overrides global variables.

Example:

```HTML
<!-- index.html -->

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="styles.css" />
    <title>Project</title>
  </head>
  <body>
    <div class="first" id="first">1</div>
    <div class="second" id="second">2</div>
    <script src="script.js"></script>
  </body>
</html>

```

```css

/* styles.css */

/* Creating Global variable */
:root {
  --blue: lightblue;
  --black: black;
}

.first {
  --color: red; /* local variable */
  border: 4px var(--blue) solid; /* global variable used */
  background-color: var(--black);
  padding: 20px;
  margin: 10px;
  color: var(--color); / * local variable used */
}

.second {
  --blue: blue; / * global variable is overridden by local variable */
  --color: cyan;
  border: 4px var(--blue) solid; /* overridden global variable used */
  background-color: var(--black);
  padding: 20px;
  margin: 10px;
  color: var(--color);
}

@media screen and (max-width: 580px) {
  .first {
    --color: white; /* local variable updated inside media query */
  }
  .second {
    --color: green;
  }
  :root {
    --blue: gray; /* global variable updated inside media query */
  }
}

```


```javascript

//script.js

const first = document.getElementById("first");
const second = document.getElementById("second");

first.addEventListener("mouseover", () => {
  let r = document.querySelector(":root");
  r.style.setProperty("--blue", "yellow");
});

second.addEventListener("mouseover", () => {
  let r = document.querySelector(":root");
  r.style.setProperty("--black", "pink");
});

```

Initial:


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

Media query: at 580px width

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

Mouse Over on First:

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

Mouse Over Second:

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

Thanks,
[Vishwak](https://twitter.com/urstrulyvishwak)
AWSome December, from OpenSearch Serverless to Application Composer
Published: 2023-01-01 09:30:00


As an editor for InfoQ, every month I follow and (try to) cover the most interesting news in the cloud space. From Blue/Green Deployments for RDS to Clean Rooms, below are the announcements and news in the AWS space that caught my attention in December. You can read the full articles on [InfoQ](https://www.infoq.com/profile/Renato-Losio/#news).

**AWS Announces GA of DocumentDB Elastic Clusters**

At the recent re:Invent conference, AWS announced the general availability of DocumentDB Elastic Clusters, a service that manages the elasticity and sharding for MongoDB workloads.

**AWS Previews VPC Lattice for Service-to-Service Communication**

To simplify networking for service-to-service communication, AWS recently announced the preview of Amazon VPC Lattice. The new capability of Virtual Private Cloud (VPC) abstracts network complexity and creates a logical application layer network that connects clients and services across different VPCs and accounts.

**AWS Previews Application Composer to Visualize and Create Serverless Workloads**

At the recent re:Invent conference, AWS announced the preview of Application Composer, a visual designer to build serverless applications from multiple AWS services. The new option helps create the architecture by dragging, grouping, and connecting services in a visual canvas.

**AWS Announces Clean Rooms for Secure Collaboration with Analytics Data**

During the recent re:Invent conference, AWS announced the preview of Clean Rooms for analytics data. The new service provides safe environments where multiple customers can securely share and analyze data with control of how the data is used, reducing the risk of sharing personal data.

**Amazon Announces Preview of OpenSearch Serverless**

AWS recently announced the preview of OpenSearch Serverless, a new option of OpenSearch service that automatically provisions and scales the resources for data ingestion and query responses. The minimum capacity required for the serverless option raised some concerns in the community.

**AWS Announces Blue/Green Deployments for MySQL on Aurora and RDS**

At the beginning of the re:Invent conference, AWS announced the general availability of RDS Blue/Green Deployments, a new feature for Aurora with MySQL compatibility, RDS for MySQL, and RDS for MariaDB to perform blue/green database updates.

To read my other articles on InfoQ, [follow me](https://www.infoq.com/profile/Renato-Losio/#news).
Excited for 2023!
Tags: java, swift
Published: 2023-01-01 09:14:01

2023 has a lot in store, and I can't wait to get started! In 2022 I worked full time in Java while exploring several other programming languages on my free time, resulting in the [busiest GitHub activity I've ever had](https://twitter.com/joshaustintech/status/1609294295818768385?s=20)! I have finally determined which secondary language to focus into becoming a marketable skill this year: Swift.

## Why Swift?
A lot of mobile developers have specialized in cross-platform app development using React Native and Flutter. I'm impressed with Flutter and expect to revisit it once I have gained work experience as a Swift developer, but I believe that the industry emphasis on cross-platform development has created a greater shortage in native Apple iPhone, iPad, and macOS developers. I really enjoy (most of) the user experiences that Apple devices have to offer and intend to take advantage of this skill shortage.

I know I'm very late to the party, and I expect that understanding Apple's frameworks like UIKit, SwiftUI, ARKit, etc. does not happen quickly, but it does mean that there are enough possibilities to explore to keep the journey from ever becoming a boring one!

This doesn't mean I won't be active in the Java community anymore. On the contrary, I [accepted a new job offer](https://www.linkedin.com/posts/joshaustintech_newjob-java-ugcPost-7013135642012372992-7oB8?utm_source=share&utm_medium=member_desktop) to work in Java full-time and expect some exciting developments in the Java ecosystem this year.

## What is in store for Java in 2023?
Java seems to have gained a second wind in recent years, and the innovation in this ecosystem is speeding up. Java [20](https://openjdk.org/projects/jdk/20/) and [LTS release 21](https://openjdk.org/projects/jdk/21/) are expected to happen this year. [RIFE2, an actively-developed pure-Java web framework](https://github.com/gbevin/rife2), has recently caught my attention. Like [Javalin](https://javalin.io/), it appears to be built on top of the successful Jetty server. I also started exploring [FXGL](https://github.com/AlmasB/FXGL) for building games with Java. Lastly, as concerns over COVID-19 variants wane I expect an increase in Java developers participating in community events. For example, Chicago finally had its first [in-person JConf event](https://twitter.com/joshaustintech/status/1574765558419148803) and the [Chicago Java User Group (CJUG)](https://www.meetup.com/chicagojug) is easing back into [in-person events](https://twitter.com/joshaustintech/status/1579997524450217987).

What new developer technologies are you the most excited about? Are you looking forward to going back to in-person events this year?
AWS Cloud Quest: Network Concepts Study Note
Tags: aws, cloud
Published: 2023-01-01 09:13:41

This is the DIY challenge of the Network Comcepts task in AWS Cloud Quest.

### DIY Steps:

1. Select the DB Server instance, and navigate to the Security tab
2. Select Security groups of this instance
3. Add Inbound rules with MYSQL/Aurora type and 10.10.0.0/24 as source.
Architecture of Kubernetes(Master Node)
Tags: kubernetes, devops, beginners, tutorial
Published: 2023-01-01 08:57:24

## Components of Master Node

1. API Server :
API server is supposed to be the front face that communicates with nodes and the other components of the control plane. Every node provides its requirements to the API server (i.e. Manifest file) which are then forwarded by API server to Controller Manager. 

2. Controller Manager : 
Controller Manager checks if all the requirements that are asked by the slave node are getting fulfilled or not i.e. if the actual state is equivalent to desired state or not. It's responsible to maintain balance b/w the two states.
Here comes the role of the etcd cluster.

3. etcd Cluster : 
If K8s is on cloud, then Cloud-Control Manager will be in role and if K8s is on premises, then Kube-Control Manager is found in action.
Etcd is responsible for storing metadata and status of a cluster in key-value pair format.
It's consistent and is highly available.
Source of truth for cluster i.e. you can find all the information of cluster with etcd.

4. Scheduler :
Kube scheduler responds to those requests which are generated by the user for creation and management of POD.
If the manifest user has not mentioned the node on which it wants POD to be created, in that case, Kube Scheduler finds the best Salve node on which POD can be created and then creates the POD on that node.
It gets information for hardware configuration from configuration files and schedules the POD’s on the slave nodes accordingly.


Architecture Diagram of Kubernetes
(https://dev-to-uploads.s3.amazonaws.com/uploads/articles/frqk1mrp4d81dyn41v2h.png)