Skip to content

Instantly share code, notes, and snippets.

@taise
Created August 7, 2017 23:41
Show Gist options
  • Select an option

  • Save taise/5de0c518cccfd63dbee1d5d9cae0dc2b to your computer and use it in GitHub Desktop.

Select an option

Save taise/5de0c518cccfd63dbee1d5d9cae0dc2b to your computer and use it in GitHub Desktop.

builderscon 2017

HTML+CSSの設計

  • CSSはどこから当てられているかわからない
    • コンポーネント化して管理したい
    • 最適なコンポーネント化の手法・粒度は何か...?

OOCSS

  • OOCSS (Object Oriented CSS)

    • まずはレゴ(Module)を作れ
    • レゴを集めてパーツを作れ
  • OOCSSは一般的になりすぎて、いろんなところで使われている

    • bootstrapとか
  • OOCSSの2つの原則

    • Separate structure and skin(構造と見た目の分離)
    • Separate container and content(コンテナと内容の分離)

ref

BEM

  • Block
    • Element
      • Modifier

ref

消えない悩み

  • コンポーネントの認識が人それぞれ
    • 粒度
    • ネーミング

Atomic Design

  • デザインのメンタルモデル

  • コンポーネント単位

    • Atoms
    • Molecules
    • Organisms
    • Templates
    • Pages
  • 細部から初めて全体を考える、全体をみて細部から見直す

  • デザインシステムを作って、デザインの一貫性を持たせる

  • ワークフローが工程ごとに断絶されたウォーターフォールだと無理

    • CSSをあてる人たちの間で認識を合わせる

ref

Enduring CSS (ECSS)

  • コンポーネントの抽象化を避ける

    • 似たようなUIパーツが登場しても別物として扱って再利用を避ける
  • 機能単位でコンポーネントを分けて、再利用したいときはコピペしたらいい

  • これまでの手法の課題

    • 無限に増えるModifierを作っていくの辛い
    • 一回作ったCSSを次にメンテするのは実際無理
  • namespace + blockがかぶらなければ基本的に大丈夫

  • DRYに頑張ってきたけど、実務では無理なことが多いので、一定諦めたほうが良いのでは

ref:

実際のCSS開発の現場

  • Atomic Design とECSSの狭間のHTMLテンプレート
  • 複数チームで運用するときにはECSSが一番適合しそう

Elements of a DDos Attack

  • malicious attempt to disrupt normal traffic
  • overwhelm target with flood
  • utilize mltiple compromised system
  • motive can be political, social, or financial

The Evlolution of DDoS

  • 2012 300G
  • 2013 400G
  • 2016 1TBps

DDoS pattern

Botnet

  • bot + network
  • Difficlut to separate goot / bad traffic

Layer

  • Application Layer Attacks
    • Single http request is cheep, but DB query is heavy
  • Protocol Attacks
    • L3, L4
  • Volumetrics Attacks
    • DSN Amplification attack

Mitigation

  • Black Hole Routing
    • Drop traffic from the network
  • Rate Limiting
    • Limiting requests over a time period
  • WAF (Web Application Firewall)
    • Filtering L7 requests with rules
  • Anycast Network Diffusion
    • Scatter attack traffic across distributed servers
    • Unicast <-> Anycast

UDP flood attack

UDP Flood Attack

targeted server utilizing resources to check and then respond to each received UDP packets resources can become quickly exhausted when a large flood of UDP packets are received, resulting in denial-of-service to normal traffic

SYN flood attack

TCP connection

  • Attacker sends high volume of SYN packets to the targeted server
  • Server respondes to each connection request and leaves an open port ready to receice the response
  • While the server waits for ther final ACK packet, attacker sends more SYN packets.

syn-flood

SYN flood attack Mitigations

  • increasing backlog queue
  • recycling the oldest half-open tcp connection
  • SYN cookies
  • using proxy service

rdb antipattern refactoring

  • データベースの寿命はアプリケーションより長い
    • はてなダイアリーはなくなっても、はてなダイアリーのDBは、hatena blogで引き継がれている

Q&A

  • mongoを消し去りたい

    • PosgreSQLのJSON型使えばええで
    • fdwをつかうと PostgreSQL経由でmongo参照/更新できるので移行の道筋も作れると思うで
  • DBの直接参照するテストって何?

    • ストアドテスト (トリガとか)
    • データの内容テスト (ユーザ減ってないよね、都道府県ふえてないよね)
    • スロークエリの速度チェックテスト
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment