Question: I ask myself lots of questions about the choice of databases for my future react-native application, because I would like a local database that stores the static data of the application. I would like also to store the data created by the user on a data server.

1. I thought using Realm for local storage
2. MongoDB for remote storage

Problem: I do not know how to synchronize remote data, because when the user is offline, I want the data to be stored locally and then when it goes offline, I want the data to be sent to the server

Can these two databases be used mutually, or is MongoDB able to store the data locally?

Answer: 
You are served the binary image, so you can directly save or process the image.  

For example:

```
url = 'https://drscdn.500px.org/photo/27428737/m%3D900/v2?webp=true&sig=3d3700c82ea515ecc0b66ca265d6909d67861fbe055c0e817b535f75b21c7ebf'
resource = urllib.request.urlopen(url)
response = resource.read()

with open('/tmp/foo.jpg', 'wb') as f:
    f.write(response)

```
What do you try to achieve? Get the image and save it fo file? If yes just keep it in file

```
def ex4():
    url = sys.argv[1]
    try:
        resource = urllib.request.urlopen(url)
        response = resource.read()
        with open('img.png', 'wb') as f:
            f.write(a)
    except Exception as e:
        print("error: ", e)

ex4()

```