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

Building (cloudless) Enterprise Applications with Ruby

Building (cloudless) Enterprise Applications with Ruby

Most people working with startups are used to the comfort of working with the cloud. When your product needs to work on-premise, you need a different mindset on the architecture and on the overall decisions you make.

------

Presented for the local ruby community in Florianópolis, SC - Brazil.

https://www.meetup.com/rubyfloripa/events/242262291/

Gabriel Mazetto

October 03, 2017
Tweet

More Decks by Gabriel Mazetto

Other Decks in Technology

Transcript

  1. View Slide

  2. Building C
    Enterprise Applications
    R

    View Slide

  3. @brodock
    blog.gabrielmazetto.eti.br
    Gabriel Mazetto

    View Slide

  4. Everyone can contribute

    View Slide

  5. View Slide

  6. But the majority of our
    clients are on-premise...

    View Slide

  7. The Enterprise market is all
    about supporting
    ...

    View Slide

  8. Forget the simplicity of
    spinning up a VM at will

    View Slide

  9. The Enterprise is all about
    the baseline

    View Slide

  10. Physical machines +
    Physical disks

    View Slide

  11. Your major stakeholder is
    the IT department

    View Slide

  12. Make their lives better and
    you win big

    View Slide

  13. How do I do that?

    View Slide

  14. You will probably have to
    support multiple
    L D

    View Slide

  15. Forget OAuth2!
    The hot protocols are
    LDAP and AD

    View Slide

  16. B E !

    View Slide

  17. Do you really need Ruby
    2.4.X or can it be >= 2.2.X ?

    View Slide

  18. Do you really need that
    optional PG extension?

    View Slide

  19. Think about progressive
    enhancement...

    View Slide

  20. Re-evaluate your

    View Slide

  21. You may not have

    View Slide

  22. You may not even have

    View Slide

  23. Few strategies...

    View Slide

  24. Provide source installation

    View Slide

  25. Provide Virtual Machine
    Images

    View Slide

  26. Make every external
    dependency configurable

    View Slide

  27. production:
    adapter: postgresql
    encoding: unicode
    database: gitlabhq_production
    pool: 10
    # username: git
    # password:
    # host: localhost
    # port: 5432

    View Slide

  28. development:
    url: redis://localhost:6379/10
    #
    # url: redis://localhost:6380
    # sentinels:
    # -
    # host: localhost
    # port: 26380 # point to sentinel, not to redis port
    # -
    # host: slave2
    # port: 26380 # point to sentinel, not to redis port

    View Slide

  29. Make your application
    behavior configurable

    View Slide

  30. gitlab:
    ## Web server settings (note: host is the FQDN, do not include http://)
    host: localhost
    port: 3000
    https: false
    user: brodock
    ## Default project features settings
    default_projects_features:
    issues: true
    merge_requests: true
    wiki: true
    snippets: true
    builds: true
    container_registry: true

    View Slide

  31. When your code
    expects S3 endpoint

    View Slide

  32. Rewrite to use fog,
    or use minio

    View Slide

  33. How to protect your
    source-code?

    View Slide

  34. Compile and pack with
    JRuby

    View Slide

  35. Use Ruby-Encoder

    View Slide

  36. But the best DRM is a good
    Contract

    View Slide

  37. How we ship?

    View Slide

  38. packages.gitlab.com
    Multiple Distros,
    Multiple Versions

    View Slide

  39. All dependencies in a
    single package

    View Slide

  40. Major release every 22nd

    View Slide

  41. Omnibus Chef
    https://github.com/chef/omnibus

    View Slide

  42. name 'ruby'
    default_version '2.3.5'
    dependency 'zlib'
    dependency 'openssl'
    dependency 'libffi'
    dependency 'libyaml'
    dependency 'libiconv'
    version('2.3.5') { source sha256:
    '5462f7bbb28beff5da7441968471ed922f964db1abdce82b8860608acc23ddcc' }
    source url:
    "https://cache.ruby-lang.org/pub/ruby/#{version.match(/^(\d+\.\d+)/)[0]}/ruby-#{
    version}.tar.gz"
    build do
    command "./configure"
    command "make"
    command "make install"
    end

    View Slide

  43. You can still plug external
    managed dependencies

    View Slide

  44. /etc/gitlab/gitlab.rb

    View Slide

  45. Is ruby viable for
    enterprise?
    Y , !

    View Slide

  46. Q ?

    View Slide