• Bloom Filter 101

    What data structure would you use to determine whether an entity is in a given dataset with speed? Many would answer “Hashtable” without hesitation. Hashtable performs well when accessing an entity among a group of entities: the average time complexity of its read operations is constant. Nevertheless, using Hashtables can be rather costly when dealing with large datasets.
    ...
  • 2024年版 Colorkrew 自社サービスのインフラ業務の現状

    こんにちは。Azure Cloud Solution Architect 兼 DevOps Engineer の秋山です。 自社サービスのインフラリードを担当しています。 前回書いたブログが2年前になってしまいましたので、ここで最近のインフラの状況についてまとめてみます。 自社サービス Mamoru Biz で AKS 導入1周年で振り返る プロダクト開発チームの増加に伴う効率化 最も大きい変化はこれです。 2年前は自社サービスイコール Mamoru Biz(現在の Colorkrew Biz) でしたが、現在は「Colorkrew ID」「Colorkrew Intra」「AI Chatシステム」や開発中のプロダクトなど多岐にわたります。 いずれの製品もクラウドインフラを活用しているため、新しいシステムのインフラ構築を効率的に行う必要があります。 自社サービスのインフラチームは私を含めて現在4人、全員受託案件など他の業務と兼任しています。 直近の1,2年ではおおまかに以下の内容を進めることで、インフラ業務が滞らない状況を作り上げてきました。 プロダクト開発チームからの依頼テンプレート化 インフラ・デプロイコードのモジュール化 最新技術のトライアンドエラーとフィードバック 本エントリではこれらを順に説明します。 プロダクト開発チームからの依頼テンプレート化 弊社ではソースコード管理に GitHub を利用しています。 新しいプロダクトの開発が始まるタイミングや既存プロダクトで新たなクラウドインフラが必要になったときに、GitHub Issue に内容をインフラチームが自身でまとめるようにしました。 そしてそれが大体パターン化されてきたため、 Issue テンプレートを用意して、プロダクト開発チームに記載してもらうようにしました。 ref: リポジトリ用に Issue テンプレートを設定する 内容は以下です 必要なクラウドインフラリソース(DB, Storage, …etc) Kubernetes リソース(Pod, CronJob, …etc) デプロイフロー 環境別の期日(Debug は ASAP, Prod は2か月後, …etc) チャットのラリーで必要な情報を埋めていくのは非効率なため、一度で大半の情報を網羅できるのは効率的です。 また、プロダクト開発チームは別のプロダクトのインフラ依頼内容を参考にすることで、サイロ化を防ぎ横のつながりや理解にもわずかながらつながるという副次的な効果も見えています。
    ...
  • A Brief Introduction to Pagination

    For many software engineers, endpoints for retrieving a list of entities are probably their favorite to implement–all they need to do is build an SQL statement that grabs all the available items, along with some other minor tasks. It’s all fun and games until the number of entities in the database becomes a bottleneck, where each GET request returns tens of thousands of items.
    ...
  • A More Elegant Alternative to Golang's Error-Handling

    Recently, I joined a new project at Colorkrew that uses Golang as its backend language. Almost everyone on the team, including myself, had no experience with Golang, so we had to start from zero. Learning Golang has been a rewarding experience so far. After all, it is one of the most in demand programming languages now.
    ...
  • Separation of Concerns: Split Your React Components into Containers and Views

    Many frontend engineers probably have experienced the head-scratching moment when their React components become so gigantic that they keep losing their train of thought when navigating through their frontend code. To salvage readability, one of the most common practices is to split up the humongous React components into smaller pieces. Traditionally, they would do this by chopping up the JSX elements.
    ...
  • RESTful API 101

    It is almost impossible for a backend engineer to be oblivious to RESTful API in the 21st century, as it is one of the most popular API types. We can mostly attribute its popularity to its scalability, flexibility, and simplicity, all of which are highly sought-after qualities in modern APIs. If you also find these qualities desirable, you should consider building APIs following the RESTful principles.
    ...
  • Introduction to Functional Programming

    The first programming paradigm that most programmers in the 21st century learn is probably Object Oriented Programming (or OOP for short). Object Oriented Programming allows us to transform real-world entities into highly abstract models with descriptive properties and executable methods to simulate their behaviors in the real world. Despite its numerous advantages, such as readability, reusability, and maintainability, it also introduces immense complexity to state management.
    ...
  • OAuth Demystified: A Straightforward OAuth Tutorial

    Incorporating OAuth (short for Open Authorization) into an application might seem somewhat intimidating and disheartening for many entry-level software engineers. After all, they need to spend hours—or even days—implementing a complicated authentication process with the correct configuration, only to realize they have merely completed a tiny feature. Despite all the hard work it entails, OAuth is a safe and efficient way for users to grant websites and applications access to their personal information.
    ...
  • Getting started with Design Systems

    Hello, I’m Bryan and a little over three months ago I moved to Japan from Scotland to join Colorkrew’s design team! When I was a child I played with Lego for hours. These simple bricks brought so much joy to this future designer. _ _ This messy pile has endless potential, with just a little imagination.
    ...
  • Async/Await: a Game Changer for Haters of Promise Chaining

    If you became a frontend engineer after 2015, chances are that you have used or at least heard about Promise. As I have covered in my previous blog, Promise can help us specify sequential relations between operations in asynchronous programming in a readable and maintainable manner. Promise object in JavaScript has methods, such as then and catch, that can help us organize the sequential execution of operations in a pattern called Promise Chaining.
    ...
  • The Whys and Hows of Promise in JavaScript

    If you have done any web development after 2015, chances are that you have heard of the concept of Promise. It wouldn’t be an overstatement to claim that Promise is ubiquitous in modern-day front-end codebases. However, many web developers—especially those who do not have much experience in front-end development—have been using Promise without thoroughly understanding its inner working.
    ...
  • ChatGPT とコーポレートエンジニアの付き合い方

    こんにちは。Azure Cloud Solution Architect の秋山です。 お客様案件の業務の時間を少し減らし、今年の1月から少しずつコーポレートエンジニアとしての活動を始めています。 Chat GPT の話 最近は触れざるをえない ChatGPT の話です。 さまざまな企業が話題の ChatGPT を企業活動に取り入れ始めています。 Colorkrew でも ChatGPT を使いたい、という人はじわじわと増えてきました。 大きく2種類のタイプがいます。 いわゆる Open AI 社の ChatGPT をただ使いたい人 開発者として API をいじりたい人 コーポレートエンジニアとしては、以下の2軸を天秤にかけながら活動する必要があります。 情報統制によって組織防衛したいが、 従業員の生産性を高めたい Colorkrew での Chat GPT の導入について 私たちが直近で進めたことは以下の3点でした。 ChatGPT(やそれに類するサービス)の利用ポリシーを定めて周知する ChatGPT の API を触れるよう、開発者用アカウントを用意する 社内で気軽に利用できる環境を整備する まずポリシーについて、社内の機密情報を AI 学習に使われることには避ける必要があります。情報管理の観点からそのあたりの周知のために整備しました。 その後、つい今週 Chat GPT の Data Control の設定が追加されたため、これに合わせてポリシーも改訂しています。 ref: How do I turn off chat history and model training?
    ...
  • All You Need to Know about Isolation Levels and Read Inconsistencies

    Just like real life, the world of computer science is replete with trade-offs. Relational databases are no exception. When interacting with relational databases, we face the dilemma between data consistency and transaction concurrency. The former guarantees the data is trustworthy, while the latter ensures relational databases can conduct transactions swiftly. Both are desirable qualities of relational databases, but we cannot simultaneously achieve them to the fullest extent.
    ...
  • CAP Theorem But Better? Introduce the PACELC Theorem

    In the previous blog, I introduced the famous CAP Theorem (please give it a read if you haven’t already before you start reading this one). It involves a trilemma of needing to give up one of the following three qualities: consistency, availability, and partition tolerance. Since all three are desirable features of modern-day distributed systems, determining which one to relinquish has become one of the most important and delicate decisions for designers of complicated distributed systems.
    ...