アプリ関連ニュース
- 2022年8月29日
- 技術情報
Introduction to Cloudflare
Cloudflare is one of the world’s largest networks. Today, businesses, nonprofits, bloggers, and anyone with an online presence can benefit from faster, more secure websites with the help of Cloudflare.
There are millions of internet properties on Cloudflare and the network is growing by tens of thousands every day. Cloudflare powers internet requests for millions of websites, serving an average of 36 million HTTP requests per second.

In the early days of the Internet, when you wanted to load a website, your computer sent a request to a server, and the server returned the requested web page.
If the server is receiving too many requests at once, its servers could be overwhelmed and crash, stalling anyone trying to access the resources they host.
This made it difficult for the owners to provide fast, secure, and reliable content. Cloudflare was created to help mitigate these issues and provide users with resources to keep their sites, apps, and blogs safe and efficient. This is done using a powerful perimeter network that delivers content and other services as close as possible so you can access information as quickly as possible.
Cloudflare also provides security by protecting Internet properties from malicious activity such as DDoS attacks, malicious bots, and other malicious intrusions. It also offers rich features like his SSL and content delivery to all websites in its network.
Also, the website owner can easily embed the app into her website without being a developer.
If you’re a developer, you can run your Javascript code in a powerful perimeter network, keeping you as close to your users as possible. This eliminates latency and improves user experience.
Yuuma
yuuma at 2022年08月29日 10:00:00
- 2022年8月26日
- 技術情報
Laravel Tips
一度に1つのレコードをseedingすると、DBが遅くなる可能性があります。より良い方法は、PHPでレコードを大量に作成し、それをChunkしてシードするで1万queryから5queryにする方法
use App\Models\User;
User::factory(10000)->create();
上記のコードを見ると、Laravelは1ユーザーを作成し、1queryでデータベースに挿入しています。これを1万回繰り返しています。そうすると、パフォーマンスにとって悪いことで、DBを遅くしてしまいます。しかし、これを簡単に解決することができます!
$records = User::factory()->count(10000)->make();
$records->chunk(2000)->each(function($chunk) {
User::insert($chunk->toArray());
});
上のコードでは、メモリ(PHP)上に10,000のユーザーレコードが作成されています。 次に、これを2,000レコードのチャンクに分割して配列に変換し、クエリの数を10,000から5つにします!
ということで、今回はこれで終わります。
金曜担当 – Ami
asahi at 2022年08月26日 10:00:00
- 2022年8月22日
- 技術情報
Introduction to NFT
NFT stands for Non-Fungible Tokens (NFT) and are typically created using the same kind of programming used for cryptocurrencies. Simply put, these crypto assets are based on blockchain technology. It cannot be exchanged or traded in a comparable manner with other crypto assets.
Like Bitcoin and Ethereum. The term NFT clearly expresses that it has unique properties and cannot be replaced or exchanged. Physical currency and cryptocurrency are interchangeable. That is, they can be traded or exchanged with each other.

Most NFTs reside on the Ethereum cryptocurrency blockchain, a distributed public ledger that records transactions and they are individual tokens that store valuable information. They can be bought and sold like any other kind of physical art, as it has a value set largely by the market and demand. Proprietary NFT data facilitates verification and validation of ownership and transfer of tokens between holders.
Blockchain technology and NFTs offer artists and content creators a unique opportunity to monetize their products. For example, artists no longer have to rely on galleries and auction houses to sell their art. Alternatively, the artist can sell it directly to consumers as an NFT. This also allows consumers to keep most of their profits. Additionally, artists can schedule royalties to receive a portion of the sale each time their art is sold to a new owner. This is an attractive feature. This is because artists typically do not receive future earnings after their art is first sold.
Art isn’t the only way to make money with NFTs. Brands such as Charmin and Taco Bell are auctioning NFT-themed art to raise money for charity.
Even celebrities like Snoop Dogg and Lindsay Lohan have jumped on the NFT bandwagon, releasing memorabilia, artwork, and unique moments as securitized NFTs.
Let me finish this article as it’s getting long. I still want to talk about this in near future.
Yuuma.
yuuma at 2022年08月22日 10:00:00
- 2022年8月09日
- 技術情報
Custom Node JS logger class with Winston package
Today I would like to share a custom Node JS logger Class using winston package. Let’s take a look.
const winston = require('winston')
nowDate = () => {return new Date(Date.now()).toUTCString()}
class CustomLogger {
constructor() {
this.logData = null
const logger = winston.createLogger({
transports: [
new winston.transports.Console(),
new winston.transports.File({
filename: `./logs/debug.log`
})
],
format: winston.format.printf((info) => {
let message = `${nowDate()} | ${info.level.toUpperCase()} | debug.log | ${info.message} | `
message = info.data ? message + `data:${JSON.stringify(info.data)} | ` : message
message = this.logData ? message + `logData:${JSON.stringify(this.logData)} | ` : message
return message
})
});
this.logger = logger
}
setLogData(logData) {
this.logData = logData
}
async info(message) {
this.logger.log('info', message);
}
async info(message, data) {
this.logger.log('info', message, {
data
})
}
async debug(message) {
this.logger.log('debug', message);
}
async debug(message, data) {
this.logger.log('debug', message, {
data
})
}
async error(message) {
this.logger.log('error', message);
}
async error(message, data) {
this.logger.log('error', message, {
data
})
}
}
module.exports = CustomLogger
The logger class is as above. It is very simple to use. Just call the class and instantiate the class as follows.
const Logger = require('./customLogger')
const logger = new Logger()
This is all for now. Hope you enjoy that.
By Asahi
waithaw at 2022年08月09日 10:00:00
- 2022年8月08日
- 技術情報
Diagram as Code
Diagrams allow you to draw cloud system architectures in Python code. It was created to prototype a new system architecture design without the use of design tools. You can also describe or visualize your existing system architecture.
I once talked about Mermaid which is a JavaScript-based graphing and charting tool that takes Markdown-inspired text definitions and dynamically creates charts in your browser. You can read more below.
Similarly, Diagram allows us to draw system architect design using just code. Diagram currently supports all major providers including AWS, Azure, GCP, Kubernetes, Alibaba Cloud, Oracle Cloud and more.
Let’s take a quick example how this works.
from diagrams import Diagram
from diagrams.aws.compute import EC2
from diagrams.aws.database import RDS
from diagrams.aws.network import ELB
with Diagram("Grouped Workers", show=False, direction="TB"):
ELB("lb") >> [EC2("worker1"),
EC2("worker2"),
EC2("worker3"),
EC2("worker4"),
EC2("worker5")] >> RDS("events")
This will result as below.

You can see we can build amazing architecture design just by using some python code. Please check more detail at their Github and quick examples here.
Yuuma
yuuma at 2022年08月08日 10:00:00