Where can I get more details about the Squidex architecture?


#1

Hello!

Where can I get more details about the Squidex architecture? I see in the source code that it uses Orleans .NET but cannot quite grasp the setup since it’s not mentioned in the Architecture section of the documentation. I also want to get a better understanding of the role of RabbitMQ and Redis. Doesn’t Orleans handle messaging?

Also, how would I create a new controller/service? I know the documentation is a WIP, but this project looks cool and I want to learn more about it. :smiley:

-PJ


#2

Just ask here, I have to improve the documentation. RabbitMQ and Redis is not needed anymore, I have to update the documentation :frowning:


#3

Oh okay, so the architecture primarily relies on Orleans now I assume? How do I add controllers/services? Would I use extensions for that? https://docs.squidex.io/architecture/02-extensions

Also, if it uses Orleans storage, does that mean we can choose whichever database and storage provider we’d like? I’d love to use PostgreSQL.


#4

Hi,

You can add controllers as you would write any other controller and just register services to the service locator:

AutoFac is also obsolete. SORRY :frowning:

PostgreSQL is not supported yet. The “big” problem is how to store json in SQL databases and write queries over it. It is planned for Q1: https://trello.com/c/UZYDfNTw/20-support-for-other-databases

I hope I can update the architecture documentation this weekend.


#5

Ahh perfect. I’ll be following development and look forward to reading the updated documentation, thanks!


#6

@Sebastian, how would I go about adding grains?


#7

Have you read the docs: https://dotnet.github.io/orleans/Documentation/grains/index.html ?


#8

Oh okay, I guess I’m just overthinking Squidex.

I can develop services and grains exactly how I normally would? I was just taking a look at the Blog sample and trying to piece together for everything integrates together. Like I see SquidexClient, SquidexEntityBase, and other Squidex classes.

When I see public sealed class Page : SquidexEntityBase<PageData> is Page the grain and PageData the grain state? Or is this unrelated?


#9

Orleans is used internally for a lot of parts of the implementation and the clustering, but if you just use Squidex for your blog or website you use the normal REST or GraphQL endpoint. Services are also an internal mechanism.

there are several kind of grains:

Domain Objects

Indices

Background tasks

Other stores

  • Tags
  • Settings
  • Grains

The big advantage is that the grains live somewhere in the cluster and the cluster management cares about the livetime, e.g. if a node goes down with content scheduling grain, the cluster will start this grain on another node. Usually you use multiple web servers for and one or many worker servers and a queue to push jobs to the workers. But then you have much more deployment artifacts like the queue.

The other advantage is performance. If you use a schema it stays in the memory for the next minutes just like a cache, so querying schemas is super fast (2-4ms) without having the problem that your cache could become stale.


#10

Thanks so much for the thorough reply, I appreciate all the info. Let me give a bit more context about what I want to accomplish.

I’m a game developer considering how I might Squidex to bootstrap a game backend. Ideally, I’d use it to create an admin and games services, including one to handle simple, turn-based game logic. Content creators would use the admin to add, remove, and edit game data like quests, NPCs, and items. That portion could make use of REST or GraphQL along with some services like getting game data, player stats, or a leaderboard. Other services like matchmaking and the game logic would make more sense as grains.

Upon looking further into Squidex further, I think I’m getting a better understanding of how it works. I thought it was more like Strapi where you create a new Strapi project and build on top of it, like creating a new project from a template, like ASP .NET Web API for example. With Squidex, you just run Squidex and create separate apps that interface with it using the Squidex client, correct?

So in my case I would deploy a Squidex instance and create my own API and Orleans app, right?


#11

Yes, you are right about the deployment strategy. Orleans was actually developed for game development (Halo I think) so it might be interesting to have a closer look to it. The community is good and I would join the Gitter group.


#12

Thanks Sebastian. I appreciate the clarity and information very much!