First of all, this is a big question, but I will try to break it. Let's look at the facts first. This is a web service. This means that we have these layers: Web Server , Middle ware application , and then Data Storage . In most highly accessible applications, the storage tier should have redundancy through replication and load management through Distribution . In most real-world applications, you do not need to store anything in RAM if the application is really not in real time, such as Multi-player Game Server or A telecom Switch . So, your application, in this case, really does not need RAM (maybe some kind of caching here and there, as we will see.)
Now this type of application includes various types of data, information that cannot have the same form at any given time, so using RDMS will make you organize everything the same way. My suggestion is that you will learn to use any document oriented database , a NoSQL DB or key-value system , because they are well-modeled for real complexities. More information about any kind of storage can be found in this pdf . I suggest you use the Couch core server , according to which your data will simply be JSON documents , schemaless and can grow as your application grows. It comes with distribution and replication, just like any application has ever needed. You can add servers or delete servers at runtime, and the whole system will simply rebalance itself. It also comes with memcached built-in for caching, so for the IN-Memory part that you mentioned, caching will do everything for you.
After the Warehouse, let's talk about the middle dishes. I want to talk about the web server as part of a medium product. You will need a very stable web server, depending on the load, and for the fact that you want to use Erlang, I suggest the yaws web server and learn how to do RESTFUL services using appmods . Using Proxies sunch as a Nginx infront of a web server cluster can help with load management. At least there are several ways to balance the load on web servers. After that, you will need an OTP application. An OTP application does not have to have gen_servers . But, as you will find out, you will find, indeed, where you need parallelization or where you need serial code. However, he worries that you want to use something that you have not yet mastered. please follow this web book and this Orielly book to help you all about Erlang. You might find a useful opportunity to try out the Chicago Boss and Mochiweb or Misultin Http server Misultin .
Another thing that I should mention in this is that you need to master your data structures and have an effective way to work with them. Poor selection of data structures can cause problems. Test and check everything at every step. Use records wherever possible, and check memory consumption at every step. There is only a lot to say about this issue, but hopefully others are also going to post their opinions.
Muzaaya Joshua
source share