Hello. Although I have a question about go, I will briefly tell my way of the developer. Yes, and also to be completely frank, I will mention: I am 16 years old. I became interested in programming when I was 9 years old, and since then I can not tear myself away. The fact is that I am not from that “shkoloty”, which clip one by one websites on WordPress, or write 88 code in php + html. I walked this way: pascal (about three months, helped me with the basics of programming) -> html, css, php -> c (three years ago) -> c ++ (two months after starting the training, X decided that it would be more appropriate to learn the advantages) -> java (after I learned the basics of the OOP; in Java, after 7 months I wanted to get acquainted with EE, I immediately reluctant to learn further; it was very cumbersome) -> php -> python (plus some Django) -> php (with the python, things were not going very well, but it took to write a testing system for thousands of two and a half lines of code for the school) -> RoR (framework awesome, but stopped to consider it as: performance problems, it is popular now, and this will not last forever, but I'm still learning) -> Play framework + Scala (everything went very well, another web project, until it reached recesses in the rock, although I liked the language, but: it is too complicated - this time, there are too many possibilities, you have to choose, you don’t know which one is better; problems with concurrency compared to go) -> and finally, go. I liked him immediately.

And now, after two and a half months of studying my question, I have a question: I want to write a large-scale web project. I will not write it alone, but only I will answer for the backend. In any case, at first. The project is completely new, it has no analogues. I will not disclose the idea, I will just say that there will be frequent database queries. Information, at least in the beginning, will be only textual, and some pictures. But there will be a lot of database queries. I could write it on PCP much faster than on go, but I want to not only write a website, I want to build a large-scale web project, as if it will be used by millions of people (although this is unlikely to happen, but there will be experience). I want to divide the web application into 4 layers, well, there is a front end, application logic, back end, datastorage. Question: Can I use Golang as server language for this purpose? Will it give me excellent performance, and will there be problems with the lack of libraries or language features, which will make it impossible to continue writing the project?

What advice can you give me on the structure of high-loaded service? And, which is better to use DB: Sql or nosql. In the course that hashhod used postgresql, but you never know. There are very good drivers for nosql, for example, Mgo, and for radish seen.

It is very important for me to know your opinion.

  • 2
    So summarize the above: Pascal -> HTML, CSS, PHP -> C ++ -> Java -> PHP -> Python -> PHP -> RoR -> Scala. Khm I'm sorry, but where is javascript? Or not mastered? - Lucky
  • javascript is in the same place as html, css and so on. Frankly speaking, I have never written websites with a developed front, so I have no experience working with frameworks like blackbone.js, and it also draws me to the backend. Yes, still. If your provocative statement is caused by my age, and you want to discuss it with me in a cultural setting - Skype: ice.just - just
  • Mentioning JavaScript, I did not mean backbone. I meant Node.js and MongoDB. - Lucky
  • 3
    @Lucky or maybe the Node.js and MongoDB light came together? - orkaan
  • one
    @Lucky The recently published book about Go, in Russian, does not agree with you) And yes, you should not think Go is exotic, of course, there are not enough "ready" programmers for Go. But I think there should be no special difficulties with support, any intelligent sishnik will easily master Go a maximum in a week. And in general, here is to take PHP as an example, coders for this language are dark, but in reality minimally intelligent 0.5% if not less. As a result, the search for a single sensible PHP coder, to support the project will result in thousands of resumes, hundreds of interviews, and maybe you will be lucky))) - Pavel Vershinin

5 answers 5

can i use as server language for this purpose golang?

Even as you can, Go is designed for this.

Will he give me excellent performance

It only depends on you, as write and "float."

Will there be problems with the lack of libraries or language features?

I even find it difficult to guess what you might need, which cannot be implemented in Go? But here is a small selection, it is quite possible that some of this is useful to you.

https://github.com/bolknote/go-gd

https://github.com/go-sql-driver/mysql

https://code.google.com/p/go-charset/

https://github.com/andelf/go-curl

  • Thanks, of course, but any library can be found on the off.site, or on go-lang.cat-v.org . Rather, even the question about the problems was semi-rhetorical, because there are many enthusiasts who have written many letters. - just
  • one
    The existence of either says nothing. Think of the fact that programmers who wrote them are not gods at all, but ordinary people. There are not so many good ones. For example, earlier the regular expression mechanism was implemented relatively slow, while in other languages, even interpreted ones, they try to accelerate it as much as possible, for example, implement it in C. I don’t know whether this mechanism was altered now or not. - Softa

Um Strange you have conclusions.

Scala is pretty simple, generally speaking. RoR is not a braking one, generally speaking, rather large sites work on it.

You are in vain there quickly jump. It is believed that in order to understand some kind of programming tool (language, framework, etc.) as follows - you need to program it for 2 years. Well, with great talent - a year and a half. And not three months. But this is your own business, I will not condemn.

You are probably looking for a "silver bullet"? A magic tool that is cooler than others on the head? There are none, otherwise all other programmers would have long since switched to it.

If the project is large, then I would suggest to be based on a developed web-framework that does not constrain the programmer, for example, on Pyramid ( http://docs.pylonsproject.org/en/latest/docs/pyramid.html ). The framework will support you and save a lot of time.

If we are talking about frequent queries to the database, then the speed of work does not depend on the programming language of the backend itself. If you go smart, write a typical puzzle from your project as a separate test and measure, you will understand that 95 percent (for example, maybe more, maybe less, but - significantly) the time is spent on the database itself, which lies outside your backend and therefore outside the programming language.

In fact, the speed depends on how you work with the database, how your program is optimized for the database. Even the simplest banal cache at the backend level will help improve performance, most likely. Moreover, even the selection of the correct database for the particulars of your data will allow you to raise your productivity up to heaven.

I would advise you to go. There are not so many serious frameworks for it yet, not so much documentation. And its features prove to be a big plus if you have complex algorithms on the backend side, and not work with the database.

With Go, you will have to write a lot yourself, invent yourself. It is very difficult and it will be very easy to get an inefficient system. It is much more efficient to use ready-made tools already available for other languages. These tools will have to learn from the inside, climb in the source code, it will be very useful to improve your skills. And time will save.

Go-lang gives you too much freedom, and with it you will get the same problem that you wrote above: “there are too many opportunities in it, you have to choose, you don’t know which one is better”. In addition, your choice will be aggravated by the fact that there are few ready-made, developed and debugged libraries and frameworks.

Anyone who gives a concrete answer to this can spit right in their eyes:

"What advice can you give me on the structure of a high-loaded service? And which one is better to use DB: Sql or nosql. Know what postgresql was used for the hashhod, but you never know. There are very good drivers for nosql, for example, Mgo, and for radish . "

For the correct answer depends very much on the specific data architecture and on the specific system architecture. The correct answers can be very opposite in each case.

In order to more or less choose the correct database you should analyze what is there for the data. What happens most often is writing or reading, to what extent simple or complex structures are stored, whether users interfere with each other (one writes the same thing that another can read at this time), simple or complex sample criteria, and a lot more.

In general, the best solution for unloading the server is an advanced caching mechanism and static (pre-generated) pages. But neither the programming language nor the database will help you with this. These are only algorithms that you have to invent yourself for your specific situation.

    Golang is a good thing for web development. Everything in other languages ​​(web server, cookies, routing, etc.) is implemented in the form of frameworks and libraries, in Golang is out of the box. The language is very simple, the code is extremely clean and understandable.

    I can recommend the Revel framework (release is expected soon), although I assume that the vehicle will prefer its bike. However. Revel - a good thing. There will be no need to deal with the architecture of basic things (there is at least VC from MVC - you need to drag your model), you can write modularly, redefine with your modules (aka filters) default default logic of basic components, and than your bike (for it allows you to concentrate on solving the problem directly, rather than check). And besides, you need to visit the project's bug tracker, look at the number of issues (open and closed), people participating in the development (permanent Rob & co). A tremendous amount of resources, joint efforts, common thoughts and discussions. What am I getting at? The work of one on the same will look like a miserable likeness.

    In the form of a module in the master branch, a component for working with the database has recently been located, and the following are supported: sqlite, mysql and postgres. As an ORM (although it is not quite ORM in the classical sense), you can use gorp. Or its fork - modl. For an example of using the first, see the booking project in the revel repository, examples directory. For MongoDB fans, Mr. Jeff has written a module for integrating Revel with this database, called (unexpectedly) - revmgo. As a sample of use, I can recommend the bloggo application from the same author on github. You can use anything, depends on the tasks. In the process of implementing my service on Revel, I concluded that MongoDB is probably cool (at least it was when I had to work with Node.js), however, Postgres solves the problem easier. The application has been rewritten.

    A narrow neck in web projects is usually a DB. However, at the stage when there is only the idea of ​​the project, the performance is absolutely not important. In the case of a successful project, you can always come back to this, solve the problem. In addition, Revel includes, for example, a standard caching module: it can be used to temporarily store information that takes a long time to get out of the database for each request (RAM is used by default for storage, however, a memcached or redis cluster can be easily adapted for this; provided out of the box).

    So, problems with the lack of libraries are unlikely. The language is statically typed, compiled. Performance is expected to be high, memory consumption is low. It is not necessary to focus on building up a high-load service in a vacuum. Better service, which simply works, than the one that works several milliseconds faster, but only in theory, because it is not there yet.

      Golang for your project fits perfectly. Just for this and developed. It is better to use MognoDb, there is a great driver for Go - mgo.

        If there are fears that there are not enough libraries, then I assure you, there is a lot of them. Register on github and bitbucket and go ahead, when searching, select the GO language and there will be any development for any question :) We used mysql in the basic project, I myself know 5 libraries for it. Now it took potgres, on the move there were three libraries. Even apache cassandra, seemingly exotic, but either already written and works fine ...

        • too exotic for me, how about full orientdb support? - zb '
        • This database is not familiar to me, it was not required, so I do not know whether there is full support or not. But the very first search found this: github.com/faddi/go-orient - bosom