wso2 - High availability with Postgres as database - postgresql

In the documentation regarding Cluster/High availability of WSO2's databases, the example is using MySQL.
Is there any information or anyone using Postgres?
How is High Availability enforced?
Using pgpool-II, for example?

You need additional tool to enforce high availability (failover, failback, switchover) in Postgres - you know that. Here is very good illustrated article by Google on how they do it using Patroni or pg_auto_failover or disk replication and Linux tools: https://cloud.google.com/architecture/architectures-high-availability-postgresql-clusters-compute-engine
Here is a list of available HA tools - especially repmgr worth your attention: https://www.percona.com/blog/2018/09/28/high-availability-for-enterprise-grade-postgresql-environments/
And here is explained how they do HA in Azure: https://www.citusdata.com/blog/2019/05/30/introducing-pg-auto-failover/

Related

Replication of Azure Postgres Flexible Server?

Is replication not supported for Azure Postgres Flexible Server?
Zone redundancy can not be treated as alternative for Disaster Recovery. Such an important feature is missing. May be until it is in preview?
Hi #Abhijeet Azure Postgres Flexible server supports logical replication. You can refer to this documentation for more details. Let me know if you have additional queries.
Regards,
Oury
If by "replication" you mean "read replicas" then indeed this is currently not supported.
High Availability options, in theory, do implement replication, but as of 10.2022 still do not support read access and are meant for fail-over purposes.
On 12th of Oct 2022 they did announce that they are working on Read Replicas, and that the feature will enter public preview "soon-ish" but no specific dates are yet communicated.
See: https://techcommunity.microsoft.com/t5/azure-database-for-postgresql/ignite-2022-continued-innovation-with-azure-database-for/ba-p/3651653

How to add Postgres to Alibaba Cloud

I have ECS at Alibaba cloud, I want to add PostgreSQL, but I can't find any Tutorials on the Internet
how to add PostgreSQL to ECS Alibaba Cloud
There are several ways on using PostgreSQL on Alibaba Cloud:
ApsaraDB RDS for PostgreSQL, which is PaaS solution for PostgreSQL on Alibaba Cloud, so you don't have to worry about installing and configuring PostgreSQL from scratch. It comes with a lot of additional features such as, high availability, disaster recovery, backup, etc. You can find their documentation on creating your PostgreSQL instance.
ApsaraDB for PolarDB, also a PaaS, which is Alibaba Cloud's homegrown RDB fully compatible with MySQL and PostgreSQL. It can support higher storage capacity, nodes clustering, and it's designed for high performance. Check out their documentation on how to create a PostgreSQL cluster.
Self-managed PostgreSQL on ECS - of cause you can still run PostgreSQL on your own ECS. There're plenty of resources on how to install and configure your own PostgreSQL. Check out the DigitalOcean's tutorial on installing PostgreSQL on Ubuntu 20.04.
You have two ways to do it.
you would just take the ECS as a Linux server. you build the PostgreSQL by yourself. it may request higher skills.
you would use the PaaS service, polardb(PostgreSQL) ,you do not need build it step by step ,just use it in 2-3 mins.
the polardb links as below:
https://www.alibabacloud.com/product/polardb?spm=a3c0i.20899616.6791778070.dbannerarelationaldb1.53fd2accf4slGC

Check postgresql replication

I have created a replicated Postgresql database (Master - Slave). I did this with an already existing Ansible Playbook (Role) , which I don't fully understand yet. The cluster currently consists of only 2 databases on different VMs.
So I want to test this replication now.
Unfortunately I have little experience with Postgresql.
How can I control whether they connect stable?
If the slave really takes over the task if the master should fail?
Many thanks for any information, tips & tricks.
Postgresql v. 9.6
Official PostgreSQL does not yet support automatic failover (Although there are multiple third-party projects which support this feature). Therefore if the deployment you have mentioned is only official PostgreSQL, after master failure, none of replicas take over the write task. But they can answer read queries if they are configured as hot_standby.
If you want to check the state of replication, in master you can check out pg_stat_replication in master.
Also these official docs would help you understand Postgres streaming replication & failover better:
https://www.postgresql.org/docs/9.6/warm-standby.html#STREAMING-REPLICATION
https://www.postgresql.org/docs/9.6/warm-standby-failover.html

MongoDB on Azure worker role

I m developing an application using SignalR to manage websockets and allow my clients to dialog between each other.
I m planning to host this back-office on an Azure worker role. As my SignalR requests carry data that is most of the time saved in the database, I m wondering if NoSQL's MongoDB instead of the classic SQL Server/Entity Framework couple should be a good approach.
Assuming that my application's data types will be strings for most of them, I think MongoDB will be a reliable and a performant solution, and it will allow me to get rid of Azure's SQL's database costs.
For information, the Azure worker role will be running on a machine with the following hardware: 1 core CPU, 3.5GB RAM and 50GB SSD storage.
Do you think I m on a good start with this architecture ?
Thanks
Do you think I m on a good start with this architecture?
In a word, no.
A user asked a similar question regarding running Redis on Worker Roles - Setting up Redis on Azure cloud service worker role - all of the content on that Q/A is relevant in the MongoDb context.
I'd suggest that you read my answer as it goes into more detail, but as an overview of why this is a bad architectural approach:
You cannot guarantee when a Worker Role will be restarted by the Azure Service Fabric.
In a real-world implementation of Mongo, you would run multiple nodes within a cluster, with a single Worker Role (as you have suggested in your question) this won't be possible.
You will need to manage your MongoDb installation within the Worker Role and they simply aren't designed for this.
If you are really fixed on using Mongo, I would suggest that you use a hosted solution such as MongoLabs (as suggested in earlier answers), or consider hosting it on Azure IaaS VM's.
If you are not fixed on using Mongo, I would sincerely suggest that you look at Azure DocumentDb (also suggested above), Microsoft's Azure NoSQL offering - I have used it in several production systems already and it is certainly a capable NoSQL solution; granted, it may not have all of the features available with MongoDb.
If you are looking at a NoSQL solution for caching of data (i.e. not long term storage), I would suggest you take a look at Azure Redis Cache, which is a very capable Redis offering.
Azure has its own native NoSQL Document database called DocumentDB, have you had a look at it? If I were you I would use DocumentDB unless there are some special requirements that you have that you have not mentioned, but from what little requirement info that you have posted DocumentDB would do just fine. I don't think that it is quite similar to MongoDB in terms of the basic functionality, see this article for a comparison between Azure DocumentDB and MongoDB.

Postgres Plus Cloud Database vs Amazon Relational Database Service (Amazon RDS)

The Postgres Plus Cloud Database was announced early this year.
As I do not have a lot of experience on database clustering, I am wondering which one I should use. Can anyone give me a compare between Postgres Plus Cloud Database and Amazon RDS in terms of features, cost and maintenance?
The requirements for our applications are:
high availability.
There will be very low load for our application.
Thanks!
PostgreSQL is not (yet) supported by Amazon RDS. So it's not easy to answer your question.
In any case: Heroku could be an alternative to Postgres Plus Cloud Database.
PostgreSQL is now supported in Amazon RDS!
See the blogpost here:
http://aws.typepad.com/aws/2013/11/amazon-rds-for-postgresql-now-available.html?sc_ichannel=EM&sc_icountry=Global&sc_icampaign=reinvent1114&sc_idetail=55698910&ref_=13