Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Typical development mistakes and problems

2kan
November 07, 2011

Typical development mistakes and problems

In process of developing server side of the interactive internet TV for one of the major Russian TV channels (REN TV) developers (and author of this keynote) have build a complex system, which interacts with a TV software, CDN & videos converting and streaming system, Erlang-deamons for monitoring the state of the air and the Rails app.

A lot of problems in the process (management and development) were met. In this keynote author will share an experience he got while working on this project.

2011, RUBYC, Kiev

2kan

November 07, 2011
Tweet

Other Decks in Programming

Transcript

  1. Typical development problems and mistakes Online TV for REN TV

    http://ren-tv.com Timothy N. Tsvetkov 2011, rubyc, Kiev
  2. Planning • We have planned API to develop • CDN

    Video have planned API to develop
  3. DDs • BDD • TDD • CI • ADD •

    DDD • ASP .NET MVC 1.0
  4. Truth • BDD — Body Dysmorphic Disorder • TDD —

    Test Driven Development • CI — Convergence insufficiency • ADD — Attention Deficit Disorder • DDD — DDD
  5. Testing limitations • We can’t test everything • You can’t

    develop an algorithm to proof that your program is correct • Testing is hard • Tests have errors • Not that effective at finding bugs
  6. Race conditions • Most developers don’t think about race conditions

    • Validates uniqueness is not race conditions safe • Some gems are not race conditions safe and it is your business to check them
  7. Optimistic locking • Each update to the record increments the

    lock_version column and the locking facilities ensure that the records instantiated twice will let the last one saved raise a StaleObjectError if the first was also updated • Doesn’t work between actions like edit/ update
  8. Pessimistic locking • SELECT FOR UPDATE • FOR UPDATE causes

    the rows retrieved for by the SELECT statement to be locked as thought for update. This prevents them from being modified or deleted by other transactions until the current transaction ends
  9. Test on race conditions • It is hard to find

    them and there is no tool for that • You can use test hooks in your production code for testing them in your rspec
  10. Deamons v. 1 • Rebar to install debs, compile and

    start • Classical OTP: Supervisor + fetchers, monitors
  11. Deamons v. 2 • Supervisors spawns workers • Workers spawn

    fetchers and monitors them • Worker never die