

Using Scala to handle exponential growth at a startup - bhanks
https://www.lucidchart.com/blog/2012/12/18/using-scala-exponential-growth-at-a-startup/

======
dkhenry
Its nice to see another shop switching to Scala. I have been advocating the
same change where I work ( currently PHP and really feeling the pinch of what
it can do ). Looks like I now have another data point to use as a success
story for transitioning away.

~~~
tikhonj
You're not yet invested in the JVM, so have you considered some alternatives
like Haskell or OCaml? I've found these to be simpler and more productive. The
main worry would be about libraries, but that really depends on what you're
doing. If it's web development, both Haskell and OCaml have top-notch
frameworks that are very good for asynchronous code. OCaml also has a very
good JavaScript compiler, so you can use it on the front-end. (Haskell can
also be compiled to JS, but I've never used it that way.)

~~~
dkhenry
I have looked at Haskell, but the problem is getting the team migrated over.
Its a lot easier to migrate a team to Scala then to Haskell. Also the library
selection for the JVM is unparallelled.

------
brown9-2
A bit off-topic but I'm curious what people familiar/experienced with other
Java web app frameworks think of the Play framework?

~~~
RyanZAG
The choices really come down to (imo anyway),

1\. JSP

2\. GWT/GAE/AppScale

3\. Play

JSP is just awful - taking PHP and trying to fit it into Java somehow. It's
just terrible and needs to be phased out ASAP. (EDIT: Probably too harsh.. JSP
works in the same way PHP works: it powers most of the web, and it does a
grudgingly good job. The ease of plopping in some dynamic content into am html
website made by a designer should not be discounted lightly for small
websites. Probably best to just use PHP and not JSP in this use case
though...)

GWT/GAE/AppScale mix is my preference. You can share code across server and
client. Building RESTful services is a dream with Jersey on the server/thick
client, and RestyGWT in the browser. The GWT compiler produces some very well
performing javascript (only a bit slower than highly optimized libraries, but
feels faster than nearly all webapp javascript). GWT also has incredibly good
tooling support in automatic sprite sheet creation, compiled CSS styles,
uibinder for declarative layouts, etc. The downsides are (1) java language, so
no functional programming and (2) compile time can get nasty when you head in
the millions-lines-of-code arena. GWT team is seemingly working on speeding up
the dev cycle with SuperDevMode and that.

Play framework is most similar to the ruby on rails approach and works
incredibly well for your standard webapp. The support for Comet and WebSockets
are particularly nice and making very dynamic 'push' webapps is the real
strongest point. The tooling can get pretty annoying at times with
features/bugs, but it is steadily improving. The biggest downside to Play is
that it is in a 'hipster phase' currently with the release of Play 2. This
means both a huge surge in interest, but that same surge can be a curse when
it drops out of 'hipster' mode in the future and loses devs. Numerous
promising frameworks/languages have hit this problem and never really recover
when the 'fashion' changes.

GWT, for example, has long since fallen out of fashion but continues to be
heavily developed because of the huge and profitable existing user base inside
Google (Adwords, etc), guaranteeing it active development for awhile to come.

~~~
state_machine
There is also Lift, one of the early scala web frameworks, but after using it
for over a year, I'd say stay away.

~~~
SkyMarshal
What drove you away from Lift?

~~~
state_machine
answered below in <https://news.ycombinator.com/item?id=4939788>

------
mylons
I don't really feel like they actually get into the specifics of how scala
actually benefited them outside of what everyone already knows about scala
from a really high level.

Bummer. I'm using scala at a small startup.

~~~
lbolla
No. But their "Hey Jude" diagram is worth a watch!
<https://www.lucidchart.com/pages/examples/flowchart_software>

------
yumraj
Since Scala is also a JVM language, from scalability perspective can someone
expand on what it offers that Java, or any other JVM language, doesn't.

I'm not asking about language semantics since I believe that to be a personal
preference, rather scalability and performance.

~~~
pkulak
As far as I know, Scala can't give you _better_ performance than Java, but I
also can't see it being too far off.

I've never really seen the benefits of Scala. Everyone whines about Java
syntax, but it's really not that bad. Verbose, sure, but it just doesn't seem
like time spent typing is where my productivity goes. Maybe I'm just getting
old, but I no longer care about language syntax as much as I used to. A
preprocessor to give me Java 8 lambda syntax would probably solve all the
issues I have with Java right now.

~~~
leothekim
"A preprocessor to give me Java 8 lambda syntax would probably solve all the
issues I have with Java right now."

That's one of the things that Scala gives you: the functional features are
there _now_ and have been for almost ten years.

Still, I know where you're coming from. I was a die-hard Java guy until I gave
Scala a shot. I'm not looking back, though I do think that Java's tooling is
much more mature than Scala's.

~~~
jbooth
Scala has much worse tooling (SBT is an oxymoron), and it's much harder to
read than Java.

Conceding that it's more fun to write, I think 'harder to read' is more
important. Scaling refers to team size and amount of functionality in addition
to requests per second.

~~~
jspthrowaway2
It's also the slowest compilation I've ever seen, even with really clever
custom tooling.

~~~
felipehummel
Scala compilation is indeed slow (although I think C++ is worse). But I always
have a "sbt ~compile" running, compiling every file as they change. So the
compilation time is pretty much irrelevant to me. While using eclipse, I
guess, you'd get the same speed too.

------
pramodbiligiri
Would love to see a more detailed post on how Scala helps you specifically.

~~~
bhanks
Been getting that feedback from others. If we did a followup article what
specifics would be most interesting to know?

~~~
pramodbiligiri
\- How did Scala make it easier to design scalable abstractions - both for
performance and for features?

\- What kind of tooling do you use? Which version of Scala?

\- Any tips around hiring and ramping up a team?

Thanks for the offer.

Edit: formatting

------
jumby
I'm so confused. Some diagramming app no one has heard of has to scale to
'exponential' growth and figure out:

* [not] loading a lot of session data on every request

* storing data across shards

* parallel processing

* a services approach

Wow, I think something is over-architected.

Curious: does exponential growth mean 2 concurrent users to 4? If they have
more than 100 concurrent users, I would be highly skeptical.

And, if they can't solve that problem with _any_ language, I would also be
highly skeptical.

~~~
dmgrow
Lucidchart employee here. Though we don't publicly release total user stats,
this recent post about 500,000 installs through the Chrome Web Store gives a
hint:

[https://www.lucidchart.com/blog/2012/10/31/500000-chrome-
web...](https://www.lucidchart.com/blog/2012/10/31/500000-chrome-web-store-
installs-what-weve-learned/)

Even with 550,000 installs there, the Chrome Web Store is just one of a number
of strong channels for Lucidchart and contributes a small minority of our user
base.

~~~
jumby
So, how many requests / second is your load balancer receiving from outside?

