teleren/devto huggingface dataset:
System Design: Enterprise Service Bus (ESB)
Tags: distributedsystems, architecture, tutorial
Published: 2022-09-14 04:27:27


An Enterprise Service Bus (ESB) is an architectural pattern whereby a centralized software component performs integrations between applications. It performs transformations of data models, handles connectivity, performs message routing, converts communication protocols, and potentially manages the composition of multiple requests. The ESB can make these integrations and transformations available as a service interface for reuse by new applications.

![enterprise-service-bus](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-III/enterprise-service-bus/enterprise-service-bus.png)

## Advantages

In theory, a centralized ESB offers the potential to standardize and dramatically simplify communication, messaging, and integration between services across the enterprise. Here are some advantages of using an ESB:

- **Improved developer productivity**: Enables developers to incorporate new technologies into one part of an application without touching the rest of the application.
- **Simpler, more cost-effective scalability**: Components can be scaled independently of others.
- **Greater resilience**: Failure of one component does not impact the others, and each microservice can adhere to its own availability requirements without risking the availability of other components in the system.

## Disadvantages

While ESBs were deployed successfully in many organizations, in many other organizations the ESB came to be seen as a bottleneck. Here are some disadvantages of using an ESB:

- Making changes or enhancements to one integration could destabilize others who use that same integration.
- A single point of failure can bring down all communications.
- Updates to the ESB often impact existing integrations, so there is significant testing required to perform any update.
- ESB is centrally managed which makes cross-team collaboration challenging.
- High configuration and maintenance complexity.

## Examples

Below are some widely used Enterprise Service Bus (ESB) technologies:

- [Azure Service Bus](https://azure.microsoft.com/en-in/services/service-bus)
- [IBM App Connect](https://www.ibm.com/in-en/cloud/app-connect)
- [Apache Camel](https://camel.apache.org)
- [Fuse ESB](https://www.redhat.com/en/technologies/jboss-middleware/fuse)


---

_This article is part of my open source [System Design Course](https://github.com/karanpratapsingh/system-design) available on Github._

{% github karanpratapsingh/system-design %}
Storage Performance: What are Latency, IOPS and Throughput and why should I care ?
Tags: aws, storage, cloudskills, ebs
Published: 2022-09-14 03:48:08

   When it comes to storage efficiency and performance, some of the basic key terms to understand are:

1. Latency
2. IOPS 
3. Throughput

Having a full grasp around these key terms will help pick the best storage for your application.  

In addition to picking up the right the volume type for your application , it is also important to confirm that the volume picked is compatible with the instance type you plan on using.

I know it seems like a lot of figure out but thankfully AWS compute Optimizer can help alleviate that burden by identifying optimal configurations using machine learning. 

To learn more about  instance and volume compatibility, check the resource that AWS has put together [here ](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-optimized.html)


## Latency
 
   Latency is the true end-to-end client time of an I/O operation; in other words, it is the time elapsed between sending an I/O to EBS and receiving an acknowledgement from EBS that the I/O read or write is complete. 
It is measured in unite of time and the lower the latency is the faster is the transaction time. 

 It is worth mentioning that Several other factors can affect the latency as well. Among them are block size and QueueLenght. The QueueLenght the number of transaction request pending. However the  QueueLenght can be also controlled by assigning a value to it. That value will determined how many IP operation can line up.


##  IOPS

   IOPS  is the Input Output Operation per second, in other terms, it is the measurement of the number read and write operations that can be carried out one second and that is used to asset the performance of a storage . SSD are the best type of storage when higher IOPS is needed .


## Throughput

   Throughput measures the ability for a storage to handle  read and write operation of large sequential data files and it is measured in Megabytes per Seconds (MB/s).

 If your application for example is serving video files online, your need will be redirected toward a HDD base  EBS Volumes since they are optimize to work very will with transactions where the dominant performance attribute is Throughput.
Data Science
Published: 2022-09-14 03:19:05

A Data Analyst usually explains what is going on by processing history of the data. On the other hand, Data Scientist not only does the exploratory analysis to discover insights from it, but also uses various advanced machine learning algorithms to identify the occurrence of a particular event in the future. A Data Scientist will look at the data from many angles, sometimes angles not known earlier.

So, Data Science is primarily used to make decisions and predictions making use of predictive causal analytics, prescriptive analytics (predictive plus decision science) and machine learning.
Which version of opengauss supports MOT feature?
Published: 2022-09-14 03:18:27

It should be introduced in all versions~ 

The official description is as follows:

openGauss introduces the MOT (Memory-Optimized Table) storage engine, which is a transactional row store optimized for multi-core and large-memory servers.

MOT is the state-of-the-art, production-grade feature of the openGauss database, which provides higher performance for transactional workloads.

Enterprises can use MOT in mission-critical, performance-sensitive online transaction processing (OLTP), which can achieve high performance, high throughput, predictable low latency, and high utilization of multi-core servers.

MOTs are created side-by-side with normal disk-based tables. The efficient design of MOT enables almost complete SQL coverage and supports the full set of database features such as stored procedures and custom functions.
How does openGauss control row-level access?
Published: 2022-09-14 03:17:37

In the actual business, there is another scenario. The same data table only allows users to view the row data that meets certain conditions. In this case, the access control needs to be accurate to the row level of the data table, so that different users can execute the same SQL query. , update or delete operations, the results read are different.

Users can create row-level access control (row level security) policies on data tables, which are expressions that take effect for specific database users and specific SQL operations. When a database user accesses a data table, the rows that meet the policy conditions are visible to the user, and the rows that do not meet the conditions are invisible to the user, thereby realizing row-level access control for the user.

openGauss provides the SQL statement CREATE/ALTER/DROP ROW LEVEL SECURITY to create/modify/delete row-level access rights policies:
Step 1: Create an information table pat_info to record the personal information of hospital patients:

openGauss=# select * from pat_info;

 patience | doctor | age

-------------+--------+-----

 peter | mary | 25

 bob | mary | 56

 julie | tom | 38

(3 rows)
Step 2: Create a row-level access control policy so that doctors can only view their own patient information:

openGauss=# CREATE ROW LEVEL SECURITY POLICY rls_select ON pat_info FOR select USING(doctor=current_user);
CREATE ROW LEVEL SECURITY POLICY

Step 3: Turn on the row-level access control switch on the information table pat_info
openGauss=# ALTER TABLE pat_info ENABLE ROW LEVEL SECURITY;
ALTER TABLE
Step 4: Grant the viewing permission of the information table pat_info to everyone
openGauss=# grant select on table pat_info to public;
GRANT

Step 5: Dr. Mary's review results:
openGauss=> select * from pat_info;
 patience | doctor | age
----------+--------+-----
 peter | mary | 25
 bob | mary | 56
(2 rows)
           Dr. Tom's findings:
openGauss=> select * from pat_info;
 patience | doctor | age
----------+--------+-----
 julie | tom | 38
(1 row)
Amazon Kinesis Cheat Sheet
Tags: 30daysofaws, day06, certifieddeveloperassociate, kinesis
Published: 2022-09-14 03:17:11

![](https://seeklogo.com/images/A/aws-kinesis-logo-B4448F5A85-seeklogo.com.png)


## About

Kinesis makes it easy to collect, process, & analyze real-time, streaming data, so one can get timely insights.

- [Documentation](https://aws.amazon.com/kinesis/)
- [User Guide](https://docs.aws.amazon.com/kinesis/?id=docs_gateway)

Amazon Kinesis enables you to process and analyze data as it arrives and respond instantly instead of having to wait until all your data is collected before the processing can begin.

- Real-time-based
- Fully managed
- Scalable

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

## Digest

- Kinesis data stream.
- Hot shard vs cold shard.
- Merging shards will decrease streams capacity.
- Kinesis adapter is the recommended way to consume streams from [DynamoDB](../dynamodb).
- Incoming write bandwidth and outgoing read bandwidth are used to calculate initial number of shards for kinesis stream.
- A single Kinesis Shard can handle 1MB per second write. 2MB per second read. It can also handle 1000 writes per second, and 5 read transactions a second


![Analysis of streaming social media data](https://d1.awsstatic.com/Products/product-name/diagrams/product-page-diagram_Amazon-Kinesis_Build-real-time-Applications.804a73506cb53369cb137d94218457382bc1b59a.png)

> - [Practice notes](https://romankurnovskii.com/en/docs/aws-certified-developer-associate/kinesis/)
> - [Questions](https://dev.to/romankurnovskii/aws-ec2-top-
questions-certified-developer-exam-27oo)
Affordable Battery Lifespan 🔋⚡
Tags: discuss, productivity, battery, lifespan
Published: 2022-09-14 02:52:45

We are all aware that in recent years, and even today, we have been working remotely or full-time online as a result of the covid-19 pandemic condition. It's been nearly two years. We all used to work in an online environment. So it shielded us from the infection. However, there are certain drawbacks that I will not discuss right now.

Let's start a debate about what everyone thinks 👀 about **laptop battery life 🔋** as we practically all use laptops to accomplish all of our office work and other stuff. Despite the fact that I use my laptop for more than 13 hours every day and charge it every three hours.

Is it affordable for laptop battery? Is it going to shorten the battery's lifespan?

> _(Feel free to express any fact that you know. 🤗)_

Let's Talk & Discuss for our own sake.
Running up a down Escalator
Published: 2022-09-14 02:41:55

I am at a point in my life where I have been applying my skills to things and creating projects, but am still lacking actual employment.  That is a hard thing to swallow from time to time.  I have been applying to places constantly, and have also gotten a few interviews here and there.  Tech challenges really are a struggle at this point though more than anything.  Some of the challenges are so complicated that I feel completely overwhelmed and fall flat on my face.  Like no matter what effort I put into learning these skills, I am still getting nowhere.  That being said though, when I take a step back and look at where I was vs. where I am now, I am able to see progress.  

A few months ago, I was not able to pass a single tech challenge question.  I got easily flustered and lost.  But as of today, I took another tech challenge.  Had 4 problems I had to solve within an hour that got progressively harder per question.  I solved the first question within 10 minutes and felt great about it.  The second question was much more challenging... but I was able to solve it eventually.  Although it took up the entire rest of my time, to the point that I couldn't answer the other 2 questions at all.  Although, ultimately I failed the challenge...I still consider that a win for getting farther than I ever have in a challenge in my past.  I AM SUCCEEDING!!!

I have thought a lot about this experience and am developing a game plan on how I can become better at these challenges.  I plan to dedicate a few hours a day to online coding challenges to build up my confidence and problem solving skills.  In the past, I have not done well with these, but I have signed up with codewars.com and have already begun this process.  Ideally, I will overcome my weakness and make it a strength!
Rails Generators: Model or Resource?
Tags: rails, ruby, programming, beginners
Published: 2022-09-14 02:36:00

Rails is a powerful tool for a developer, you can do so much with just a few keystrokes in the command line. When you first learn about generators the one thing that goes through your mind is "This will make my life so much easier", And it will. But this is the moment when you should take a step back and try to understand why and how will this magical generators will change your life. First you need to know what they are. 

**What are Generators??**

Rails generators are command line tools that are used for automating the process of creating or editing files with boiler plate code. In essence, they execute Ruby code much like a script and create or update files based on templates, user input and whatever logic necessary.

Now that you know that lets run some generators! 

In the command line, you can type `rails generate` or `rails g` these will both get you the same result. Running this by itself will give you a list of available generators. 

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

and much more. 

Let's generate some code.

We will begin by creating a migration. 

Running this code `rails g model car name brand model year:integer trim`

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

This will create a migration a model and some test. 


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

This is great! we were able to get all that from just one line of code in the terminal. 

What if we can get even more done from the terminal? make this even easier! that where resource come in! by just changing the command we ran before from model to resource `rails g resource car name brand model year:integer trim `

We get even more! migrations, models, test, controllers, routes and serializer.

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

If you are starting to get a bit overwhelmed, well it is. 
This is the time that you as a developer need to stop and think, generating all that code for you is amazing! It will improve your work flow but if you are still new to rails and generators this is where you need to slow down. Understanding what is happening with the code you generate is very important, it will help you debug your code _when_ something goes wrong. Key word is _when_ not if, we will all make mistakes while writing code. 

Shortcuts have no place in programming, besides wouldn't you want to understand all that magical code you write. 


[generators](https://guides.rubyonrails.org/active_record_migrations.html#model-generators)
A Brief Introduction to Ruby
Tags: ruby, tutorial, rails
Published: 2022-09-14 02:18:34

This is a brief introduction to Ruby. Ruby is a masterfully designed language. It has been around for many years and is incredibly popular, especially among web developers. It is a friendly programming language that is intuitive and a joy to work with.

This introduction to Ruby is for people who have some programming experience. One interesting feature of Ruby is the ability to pass code around to methods to be executed. This is a very powerful technique.

What you will see in this post is a collection of code playbacks. Playbacks were designed to help guide a reader through code examples. You will get to see how I build programs up from scratch and hear me explain it in comments that I make along the way. These comments will have text, screenshots, and hand drawn pictures. This will allow you to get inside my head and hopefully this will demystify the programming process. When you click on a playback title below it will open a new tab. Then, just click on the comments on the left hand side of the screen and you will be guided through the code.

Click on the first playback below to begin your journey with Ruby!

[1.1 Hello Ruby!!!](https://markm208.github.io/rubybook/chapter1/01/index.html)
[1.2 Variables and Types](https://markm208.github.io/rubybook/chapter1/02/index.html)
[1.3 Selection and Looping](https://markm208.github.io/rubybook/chapter1/03/index.html)
[1.4 Arrays](https://markm208.github.io/rubybook/chapter1/04/index.html)
[1.5 Hashes](https://markm208.github.io/rubybook/chapter1/05/index.html)
[1.6 Methods](https://markm208.github.io/rubybook/chapter1/06/index.html)
[1.7 Closures](https://markm208.github.io/rubybook/chapter1/07/index.html)
[1.8 Iterators](https://markm208.github.io/rubybook/chapter1/08/index.html)
[1.9 Classes in Ruby](https://markm208.github.io/rubybook/chapter1/09/index.html)
[1.10 Interacting Classes](https://markm208.github.io/rubybook/chapter1/10/index.html)
[1.11 Unit Testing in Ruby](https://markm208.github.io/rubybook/chapter1/11/index.html)

Here is a link to the original book:
[A Brief Introduction to Ruby](https://markm208.github.io/rubybook/)

If you'd like to stay connected and get updates when I add new playbacks you can follow me on twitter: [@markm208](https://twitter.com/markm208). I have several different free programming books [here](https://markm208.github.io/). Check them out!
HLS Streaming Player
Tags: browser, extension, opensource
Published: 2022-09-14 00:46:18

🎥 Free [HLS Streaming Player browser extension](https://github.com/Chromo-lib/m3u8)

<p align="center">
  <a href="" rel="nofollow">
    <img src="https://i.imgur.com/kMH6r1a.png" style="max-width:100%;"></a>

  <a href="https://microsoftedge.microsoft.com/addons/detail/oigohokpjennhfmeegflfcbpfbohlkmn" rel="nofollow">
    <img src="https://i.imgur.com/n49Wiu2.png" style="max-width:100%;"></a>
  <br><br>
</p>

## Capture
![M3u8 player](https://github.com/Chromo-lib/m3u8/blob/main/capture.png?raw=true)

## License
MIT
Creattie | Made with Vue JS
Tags: vue, javascript, webdev
Published: 2022-09-14 00:43:04

![Creattie | Made with Javascript | Vue JS](https://res.cloudinary.com/madewithjavascript/image/upload/v1662423767/large_creattie_made_with_vue_js_5c6c50c086.png "Creattie | Made with Javascript | Vue JS")


### Creattie is a curated library of Lottie animations and animated icons created by award-winning artists.

> ## Premium Lottie Animations
> Curated collections with strong design principles
> 
> ### Premium Quality
> Each design is created with immense attention to detail and undergoes a rigorous quality control process.
> 
> ### Cohesive Collections
> Industry specific collections allowing you craft unique projects with consistent content.
> 
> ### Customize your vision
> #### Colors
> Bring your design to life with the custom color editor
> 
> #### Animation settings
> Customize stroke width, speed, size, and animation triggers directly in seconds.
> 
> #### Choose format
> All designs are available in
> - JSON
> - GIF
> - SVG
> - PNG
> - MP4
> 
> All Lottie animations have a static version
> Switch from animated to static version in one click


## Want us to feature your project

[Submit your Project to Made with Javascript](https://madewithjavascript.club/submit-project)


## Project already shared on our social media handles.

| SocialMedia | SharedLink |
| ----------- | ---------- |
| Twitter | [Creattie on Twitter](https://twitter.com/withjavascript/status/1569843969604947970?s=20&t=uHrH3LYTOq7eslfs3cTuGQ)
 |
| Medium | [Creattie on Medium](https://medium.com/@madewithjavascript/creattie-made-with-vue-js-948b062e30b)
 |
| Facebook | [Creattie on Facebook](https://www.facebook.com/madewithjavascript/posts/pfbid02WfHpWgXdH9cMPse8jdoVre5p2wBetxL74WbRK6xQdpkS47qRqU8ELvbfgcfWcYkhl)
 |
| Tumblr | [Creattie on Tumblr](https://www.tumblr.com/madewithjavascript/695326783109840896/creattie-made-with-vue-js-creattie-is-a?source=share)
 |
| LinkedIn | [Creattie on LinkedIn](https://www.linkedin.com/feed/update/urn:li:activity:6975609541170184192)
 |
| Pinterest | [Creattie on Pinterest](https://pin.it/7i8K1am)
 |


Filled Under:

 - Made with Javascript
 - Made with Vue JS
Node Reload
Tags: tooling, node, opensource
Published: 2022-09-14 00:38:47

↻ ♾️ [NodeRel](https://github.com/wutility/noderel)
NodeRel is a tool that automatically restarting the node application when file changes.

![downloads](https://badgen.net/npm/dt/noderel) ![version](http://img.shields.io/npm/v/noderel.svg?style=flat-square)

- Fast and simple to use.
- Automatic re-running.
- Manual restarting.
- Monitoring multiple directories.
- Ignoring files.
- Delaying restarting.

# Installation
```shell
npm install -g noderel 
# yarn global add noderel
```

## CLI
```shell
# all configs are optional 
noderel --entry bin/server.js --watch routes,app --delay 150 --verbose=false --allow-restart=true

# short
nnoderel -e tests/server.js -w routes,app -d 150 -v -r
```

## API
```js
const noderel = require('noderel');

noderel(configuration?: Object): void
```

## Configuration

| Prop     | Default                          | Description                   |
|----------|----------------------------------|-------------------------------|
|entry     | `(package.json).main`            | Set entry file |
|watch     | `.`                              | Set the watch directories or files. |
|ignore    | `/node_modules\|(^\|[\/\\])\../` | which\'s files or folders should be ignored |
|delay      | `100`                            | Realod time between changes (ms). |
|verbose   | `true`                          | Show logs |
|allow-restart | `true` | allow restart when typing `rs`|

## Config file
```js
// noderel.json
// A config file can take any of the command line arguments as JSON key values, for example:
{
  "entry": "tests/server.js",
  "watch": ["src", "bin"],
  "ignore": "**/{node_modules,tests,dist,temp,.git}/*",
  "delay": 150,
  "verbose": true,
  "allowRestart": true // allow restart when typing `rs`
}
```

## Capture
![Capture](https://github.com/wutility/noderel/blob/main/capture.png?raw=true)

# License
![MIT](https://badgen.net/npm/license/noderel)
Vconsole
Tags: javascript, typescript, bitbucket, webdev
Published: 2022-09-14 00:34:43

[Vconsole](https://github.com/haikelfazzani/vconsole) is advanced Javascript console and code editor

## Support
- [x] Typescript
- [x] Coffeescript
- [x] LiveScript
- [x] Babel
- [x] HTML

## Built with

- Bitbucket OAUTH 2.0
- Bitbucket Snippet API
- Monaco Editor
- React, React Router DOM
- Context API

## Captures
![vconsole](https://i.ibb.co/YtHdRWq/vconsole.png)

# License
MIT
Go: Deploy Go (Gin) Application on Docker
Published: 2022-09-14 00:28:10

ตัวอย่างกันลืมของ Dockerfile ที่เอาไว้ Deploy Go Application โดยการ Clone จาก Private github ไปบน Docker (Portainer)

```
FROM golang

WORKDIR /app

RUN git clone -b develop https://<username>:<token>@github.com/<username>/<gitrepo>.git .

RUN go mod download

ENV GIN_MODE=release

COPY ./ ./

RUN go install github.com/cosmtrek/air@latest

# Don't forget to add .air.toml .gitignore
RUN air init

EXPOSE 8888

CMD ["air"]
```